Verbs and Adverbs: Multidimensional Motion Interpolation Using Radial Basis Functions CharlesRose BobbyBodenheimer MichaelF.Cohen [email protected] [email protected] [email protected] MicrosoftResearch Abstract Thispaperdescribesmethodsanddatastructuresusedtoleveragemotionsequencesofcomplexlinked figures. We present a technique for interpolating between example motions derived from live motion captureorproducedthroughtraditionalanimationtools. Thesemotionscanbecharacterizedbyemotional expressivenessorcontrolbehaviorssuchasturningorgoinguphillordownhill. Wecallsuchparameterized motions“verbs”andtheparametersthatcontrolthem“adverbs.” Verbscanbecombinedwithotherverbs to form a “verb graph,” with smooth transitions between them, allowing an animated figure to exhibit a substantialrepertoireofexpressivebehaviors. Acombinationofradialbasisfunctionsandloworderpolynomialsisusedtocreatetheinterpolation spacebetweenexamplemotions. Inversekinematicconstraintsareusedtoaugmenttheinterpolationsin ordertoavoid,forexample,thefeetslippingonthefloorduringasupportphaseofawalkcycle. Oncetheverbsandverbgraphhavebeenconstructed,adverbscanbemodifiedinreal-timeproviding interactiveorprogrammaticcontroloverthecharacters’actions. Thisallowsthecreationofautonomous charactersinavirtualenvironmentthatexhibitcomplexandsubtlebehavior. 1 Introduction Creating believable animated human figures is a difficult task, even with the most sophisticated software available. Once an acceptable segment of animation has been created, either by an animator or through motioncapture, theresultsarestilldifficulttoreuse. Theadditionalworktomodifytheanimationmaybe almost as time consuming as creating the original motion itself. Furthermore, the exact style or structure neededforaparticularmotionmaynotbeknownuntilruntime. Areal-timecontrollableanimationsystemis neededforinteractiveapplications,suchasa3Dvideogame,oravirtualenvironment. Researchintocontrollablehumanfigureanimationcanbedividedintothreemajorgroupings: procedural, simulated,andinterpolated. Proceduralanimationusescodefragmentstoderivethedegreeoffreedom(DOF) values at a particular time. The procedures can be as sophisticated as needed in order to provide different motionstylesortoreacttodifferentconditionsofthesimulatedenvironment. Dynamicallysimulatedfigure animation uses controllers together with a simulated human to generate motion. The degree to which this methodsucceedsisboundedbyhowaccuratelyhumanmotionisunderstoodandmodeled. Boththesemethods havethedisadvantagethattheycanalienateclassicallytrainedanimatorsandthattheydonoteasilymakeuse 1 ofmotioncapturetechnology. Thisisimportantsinceanimatorsandmotioncapturesystemseachproduce compellingresults. Toleveragetheirqualities,asystemmustusewhattheseresourcesprovide. Interpolatedanimationisthethirdmajorgrouping. Thismethodusessetsofexamplemotiontogetherwith aninterpolationschemetoconstructnewmotions. Theprimaryproblemsofthisapproachareinprovidinga setofmeaningful,highlevelcontrolknobstotheanimatororruntimesystem,maintainingtheaestheticofthe sourcemotionsintheinterpolatedmotions,andmotionextrapolation. Anotherconsiderationisthedifficulty ofacquiringtheexamples. Eachisprecious. Additionally,foraninterpolatedmotionschemetobeusedina run-timeenvironmentratherthanearlierinaproductionpipeline,itmustbeefficient. Forthesereasons,an approximationschemeusingradialbasisfunctionswaschosen. Thispaperdescribesasystemforreal-timeanimationbyexamplethataddressessomeoftheseproblems. Throughthecreationofparameterizedmotions,whichwecall“verbs”parameterizedby“adverbs”,asingle authoredverbproducesacontinuousrangeofsubtlevariationsofagivenmotionatreal-timerates. Asaresult, simulatedfiguresaltertheiractionsbasedontheirmomentarymoodorinresponsetochangesintheirgoals orenvironmentalstimuli. Forexample,wedemonstratea“walk”verbthatisabletoshowemotionssuchas happinessandsadness,anddemonstratesubtlevariationsduetowalkinguphillordownhillwhileturningto theleftandright. Thepaperalsodescribestheconstructionof“verbgraphs”thatactasthegluetoassembleverbsandtheir adverbsintoaruntimedatastructure. Verbgraphsprovidethemeansforthesimulatedfigurestoseamlessly transitionfromverbtoverbwithinaninteractiveruntimesystem. Finally,webrieflydiscussthediscreteevent simulatorthathandlestheruntimemainloop. 2 Related Work The idea of altering existing animation to produce different characteristics is not new. Unuma et al. [16] useFouriertechniquestointerpolateandextrapolatemotiondata. Amayaetal.[1]alterexistinganimation byextractingan“emotionaltransform”fromexamplemotionswhichisthenappliedtoothermotions. For example,“anger”fromanangrywalkisappliedtoaruntogeneratean“angry”run. Ourworkdoesnotfollow thisapproachinthatitdoesnotapplycharacteristicsofonemotiontoanother,butinsteadassumesthatthe initiallibraryofmotionscontainstheseemotions. Unlikethesetwotechniques, ourmethodisnotbasedin thefrequencydomainandthuscanhandlenon-periodicmotionswhichearliermethodsfailtocapture. Bruderlin and Williams [6] use multitarget interpolation with dynamic timewarping to blend between motions, and displacement mappings to alter motions such as grasps. Witkin and Popovic´ [19] present a similarsystemforeditingmotioncaptureclips. Theformerworkisinthesamespiritasours,andaddresses many of the same difficulties, specifically the necessity of selecting appropriate key times for interpolation andtheconsequentneedfortimewarping. Onedifferencebetweenthetwoapproachesliesinthechoiceof interpolationtechniques: BruderlinandWilliamsusemultiresolutionfilteringofjointanglesinthefrequency domain,whereasourtechniquedecouplessolutionrepresentationfrominterpolationmechanism. Perlin[11] has approached this problem in a very different way by using noise functions to simulate personality and emotioninexistinganimation. BothWileyandHahn[18]andGuoandRoberge´[8]producenewmotionsusinglinearinterpolationona setofexamplemotions. BothtechniquesrequireO(2d)examples,wheredisthedimensionalityofthecontrol space. OurtechniqueusingradialB-splinesrequiresO(n)examplestoestablishthebaselineapproximation andO(n3)tocomputetheresultinganswer. Tocompare,aDelaunaytriangulationofthedatawouldrequire O(nceil(d=2))tocompute,whend(cid:21)3. 2 TheworkofWileyandHahniscloselyrelatedtoourown,theadditionaldifferencebeingthattheirtime scalingisuniform,whereasoursisnon-uniformandbasedonkeyevents. Whileuniformtime-scalingobviates theneedforananimatortoselectstructurallysimilarposesduringmotions,itassumedthattherepertoireof motionsbeinginterpolatedbetweenmustbeverysimilarintime. Whenthisassumptionisviolated,oddities inthemotioncanresult. WileyandHahnalsoreparameterizeandsampletheirmotionsonamultidimensional gridandthenperformsimpleinterpolationsatruntime. Thisrequirescomputationandstorageexponentialin thenumberofparameters. Additionally,neitherWileyandHahnnorGuoandRoberge´ discusstheblendingofsubsetsofexamples, whichwouldarisewhennewexamplesareplaced“between”oldexamplesasadesignerrefinestheinterpolated motion space. Our technique, on the other hand, is refined by more examples as required. As we use an approximation method based upon radial B-splines with compact support to perform the interpolation, our exampleshavelimitedeffectoverthespaceofanimations,thusensuringthatsubsetsoftheexamplesareused atruntimeasappropriate. HodginsandPollard[9]interpolateoverthespaceofcontrollawsasopposedtojointtrajectories. The controlfunctionsdefinethegainsinthejointswithinaphysicaldynamicsframework. Byinterpolatingthe control,foranactionsuchasrunning,theycanalterthephysicalcharacteristicsofthefigurefromachildto anadultorfromamaletoafemalecharacter. An important distinction in our work is that the interpolation is performed simultaneously in real-time over multiple dimensions, such as emotional content and physical characteristics. Although we apply the techniquestointerpolatingtrajectoriescharacterizedbycoefficientsofsplinecurves,themethodspresented here are also applicable to coefficients in the Fourier and other domains. It may also be possible to apply similarideastocontroltheparametersofaphysicallybasedmodel. In the context of autonomous agents, our work presents a back-end for applications such as games, the Improv[12]system,andtheworkproposedbyBlumbergandGalyean[4]. Thehighlevelcontrolstructures foundinsuchapplicationsarecapableofselectingverbsandadverbswhiletheworkwepresenthereprovides thelowlevelanimationitself. Thus,wecreatethemotioninreal-timefor“directable”creaturesasdiscussed byBlumbergandGalyean. 3 Verbs, and Adverbs Thefigureanimationsystempresentedhereconsistsoftwomainparts. Anofflineauthoringsystemprovides the tools for a designer to construct controllable motions, verbs, from sets of examples. In addition, the authoring system provides tools for constructing transitions between verbs and for putting the verbs and transitionstogetherinaverb-graph. Thisstructurebecomesthecontrolledobjectfortheruntimeportionof theVerbsandAdverbssystem. Theruntimesystemcontrolstheinvocationofverbsandtheevaluationofthe figure’sposeateachframeoftheanimation. Webeginwithadiscussionoftheauthoringsystemandthen moveontotheruntimesystem. RefertoTable1forthesymbolsusedinthetext. The simulated figures, or “creatures,” discussed here are assumed to be well represented as a hierarchy ofrigidlinksconnectedbyjoints. Eachjointmaycontainoneormorerotationaldegreesoffreedom(DOF). The root of the hierarchy has six special DOFs which represent the position and orientation of the figure in the global coordinate frame. In particular, we use a 46 DOF human figure. Each DOF’s motion is represented as a function through time (cid:18)j(T); j = 1:::NumDOF, where T represents clock time from [0::durationofthemotion]whichwillshortlybedefinedaskeytimetime. GiventhesemotionsoftheDOFs, onecanrenderthecreatureatanypointintime. Traditionally hand-crafted or motion captured animation segments have DOF functions of 1 variable, 3 Object Variable Subscript subscriptmeaning subscriptrange Motionexample M i Motionexamplenumber 1::NumExamples DOF (cid:18) i Motionexamplenumber 1::NumExamples j DOFindex 1::NumDOF B-spline B k B-splineindex 1::NumCP B-SControlPoint b i;j;k PointinAdverbSpace p i Keytime K m Keytimeindex 1::NumKeyTimes Radialbasis R i basisassociatedwithMi RadialCoefficient r i;j;k LinearBasis A l Adverbindex 1::NumAdverbs LinearCoefficient a j;k;l Distance d i Distancetopi Time Variable range Clocktime (cid:28) Keytimetime T 0::KNumKeyTimes Generictime t 0::1 Table1: Terminology time. TheDOFfunctionsforaverbareneverexplicitlyrepresented,butratherevolveatruntimethroughthe interpolationofexamplemotionsweightedbychanginginterpolationparametersoradverbs. Theseadverbs mayrepresentemotionalaxessuchashappy-sad, knowledgeable-clueless, andphysicalparameterssuchas whether,inthecaseofawalkverb,thefigureiswalkinguphill,ordownhillandwhetherthemotioniscurving totheleftorright. Thesetofadverbaxesdefineamultidimensionaladverbspaceofallpossiblevariations foraparticularverb. Verbsareconstructedfromsetsofsimilar,butdistinctexamplemotions. Theseexamplescanbeobtained keyframingorwithamotioncapturesystem. Ineithercase,certainrestrictionsonthesetofexamplesapply. The primary restriction is that all examples for a verb be structurally similar. A set of example walks, for instance,mustallstartoutonthesamefoot,takethesamenumberofsteps,havethesamearmswingphase, andhavenospuriousmotionssuchasahead-scratch. Theotherprimaryrestrictionisconsistentuseofjoint angles. AnatomicallyimplausiblesettingsoftheDOFvaluescanyieldthesameoveralleffectasaplausible settingduetotheredundantnatureoftwoandthreeDOFjoints. Bodenheimeretal.[5]presentmethodsto ensureconsistentDOFvaluesformotioncaptureddata. Eachexamplemotionisannotatedbyhandwithasetofadverbvalues,placingtheexamplesomewhere intheadverbspace. Additionally,asetof“keytimes”,instantswhenimportantstructuralelementssuchasa foot-down occurs, must be specified. These keytimes are used to preprocess the examples into a canonical timelineforinterpolationandforlatersynthesisofthephrasingfortheinterpolatedmotions. Finally,examples are defined by a set of intermittent constraints (e.g., that the foot should not slip while in contact with the floor). AverbM isthereforedefinedbyasetofexamplemotionsMi, M =f(cid:18) (T);p ;K :i=1:::NumExamples; i ij i m j =1:::NumDOF;m=0:::NumKeyTimesg 4 wherethe(cid:18)ij(T)aretheDOFfunctionsfortheithexampleMi,pithelocationoftheexampleintheadverb space,andK thesetofkeytimeswhichdescribethephrasing(relativetimingofthestructuralelements)of theexample. Thetimeparameter,T,representsclocktimebutwiththeclockstartingat0atthebeginningof themotionexample. 3.1 ExampleMotions EachexamplemotionMiisdefinedbyofanumberofDOFfunctions,denotedby(cid:18)ij(T). Each(cid:18)ij (i.e.,the jth DOFfortheith example)isrepresentedasauniformcubicB-splinecurvespecifiedbyNumCP control points, NuXmCP (cid:18) (T)= b B (T) ij ijk k k=1 wheretheBk(T)aretheB-splines,andthebijk arethescalarB-splinecoefficientsorcontrolpointsforthe ithexampleMi. Bartelsetal.[3]containsanextensivediscussionofB-splinesandtheirproperties. Theinterpolationtechniquepresentedheredecouplestheinterpolationschemefromtherepresentationof theexamples. Theexamples,therefore,couldbeencodedusingothermethods,suchasawaveletorFourier decomposition. 3.2 TimeWarping The keytimes are used to define a piecewise linear mapping fromT 2 f0:::KNumKeyTimesg to a generic timet 2 f0:::1g. Thefirstkeytimeoftheverb,K1,isdefinedtobe0. Thelastkeytime,KNumKeyTimesg marksthedurationoftheverb. Inthecaseofcyclicverbs,suchaswalking,itmustalsomarkthesameevent asthefirst. Moregenerally,givenaT between0andKNumKeyTimes (cid:18) (cid:19) T −K 1 t(T)= (m−1)+ m (1) K −K NumKeyTimes −1 m+1 m forthelargestmsuchthatT >Kmandkeepinginmindthatt(0)=0. ThismappingisillustratedinFigure1. Inotherwords,ateachkeytime,thegenerictimet(Km) = NumKemy−T1imes−1. Atthethirdoffourkeytimes, t= 2 asthekeytimeswillbeat0, 1, 2,and1. Betweenkeytimes,tislinearlyinterpolated. 3 3 3 Once all the examples have had their time reparameterized to generic time t, they are said to be in a canonicalform. Foragivent,allexampleswillbeatthesamestructuralpointofthemotion,regardlessof phrasingoroverallduration. Examplesareinterpolatedwithinthisgenerictimeframe. Thekeytimeequations1 themselvesarealsointerpolatedbetweenexamples. Theinverseofthisinterpolatedtimingfunctionisthen appliedtountimewarptheinterpolatedmotiontorecapturephrasingandduration. 3.3 InverseKinematicConstraints In addition to being used to timewarp the motions, keytimes also specify periods during which kinematic constraintsneedtobeenforced. Forexample,keytimesofawalkmightbeheel-strikeandtoe-off. Between thesekeytimes,thefootmustremainstationary. Thevaluesforspecificconstraintconditionssuchasthelocationtheendeffector(e.g., thefoot)should maintainarenotsetwhentheyaredesigned,butaresetatplaybackwhenakeytimethattriggersaconstraintis 5 T Key-times for Example Motion B Interpolated Key-times K (p) m Key-times for Example Motion A T 1 t K K K K K 1 2 3 4 5 0.0 t( T ) 1.0 1 Figure1: MappingBetweenGenericTimeandKeytimes 6 crossed. If,forexample,whenakeytimeiscrossedtriggeringafootconstraint,thefoot’shorizontallocation isat(x;z)andtheheightoftheflooratthatpointis y = floor(x;z), thentheconstraintlocationissetto (x;y;z). Thisconstraintpositionismaintaineduntilanotherkeytimereleasingtheconstraintiscrossed. Constraintsareenforcedatruntimewithafastinversekinematicsoptimization. Atagivengenerictime t,acreatureisfirstpositionedindependentofanyconstraintsbyevaluatingtheactiveverb(s)atthattime. In general,thiswillplacetheendeffectorclosetotheconstraintpoint. Theymakethesubtlechangesneededto exactlysatisfytheconstraint,wewillonlyconsidermodifyingDOFsbetweentherootandtheendeffector. ThechangesintheseDOFsneededtosatisfytheconstraintarefoundateachframeatruntimebysolvingthe linearsystem(typicallyofsize5or6)oftheform J(cid:1)(cid:18) = (cid:1)x (2) whereJistheJacobianoftheDOFwithrespecttothemotionoftheendeffector,(cid:1)xisthevectorfromwhere theendeffectorwasplacedbytheverbtotheconstraintpoint,and(cid:1)(cid:18) istheamounttheDOFneedstobe perturbedtoholdtheendeffectorinplace. SeeGirard[7]orWatt[17]fordetailsonsuchinversekinematic problems. 4 Verb Construction Oncetheexamplemotionshavebeenspecifiedforaverbwiththeirassociatedkeytimesandadverbsettings, thenextstepistoconstructacontinuous“space”ofmotionsparameterizedbytheadverbs. Thedimension ofthisspaceisthenumberofadverbs,NumAdverbs. Apointinthisspaceisdefinedbythespecificvalues of the individual adverbs. The point may move from moment to moment during the interactive animation if,forexample,thecharacter’smoodchangesorthecharacterbeginstowalkupordownhill. Thegoalisto produceatanypointpintheadverbspaceanewmotionM(p;t)derivedthroughinterpolationoftheexample motions. Whenpisequaltotheadverbsettingsforaparticularexamplemotioni,thenM(p;t)shouldequal Mi(t). Each example motion has one free variable for each B-spline control point for each DOF and one free variable for each keytime. The time warping described above ensures that corresponding control points in each example motion specify similar moments in each motion, even if the overall lengths of the example motionsdiffer. Thisallowsustotreattheexamplemotioninterpolationasaseparateproblemforeachcontrol pointandeachkeytime(i.e.,NumCP (cid:2)NumDOF +NumKeyTimes individualinterpolationproblems). Thestandardproblemofmultivariableinterpolationisasfollows: givenN distinctpointspi inRn and N values vi in R, find a function f : Rn ! R such that for all i, f(pi) = vi, and such that f does not oscillatebadlybetweenvalues. Thehighdimensionalityofthespacedefinedbytheadverbs, coupledwith thedesiretorequirefewexamplemotions(perhapsonlytwotothreetimesthenumberofadverbs),presents difficultiesformanyinterpolationmethods. Giventhesedifficulties,acombinationofradialbasisfunctions andloworder(linear)polynomialswasselectedforthisproblem. Thepolynomialfunctionprovidesanoverall approximationtothespacedefinedbytheexamplemotions. Italsoallowsforextrapolationoutsidetheconvex hullofthelocationsoftheexamplemotions. Theradialbasesthenlocallyadjustthepolynomialtointerpolate theexamplemotionsthemselves. Radialbasisfunctionshavetheform: R (d (p)) i i whereRiistheradialbasisassociatedwithMianddi(p)isameasureofthedistancebetweenpandpi,most 7 oftentheEuclideannormkp−pik. Becausesumsofradialbasescannotrepresentanaffineorpolynomial function,radialbasissetsareoftenaugmentedbyaddingapolynomialoffixeddegree. DetailsofthemathematicsforthistypeofinterpolationcanbefoundintheseminalworkofMicchelli[10] andinthesurveyarticlebyPowell[13]. Radialbasisfunctionshavebeenusedincomputergraphicsforimage warpingbyRuprechtandMu¨ller[15],andAradetal.[2]. ThevalueofeachinterpolatedDOFcurvecontrolpointinthisspace,bjk(p),isdefinedas NumEXxamples NumXAdverbs bjk(p)= rijkRi(p)+ ajklAl(p) (3) i=1 l=0 wheretherijkandRiaretheradialbasisfunctionweightsandradialbasisfunctionsthemselvesandtheajkl andAlthelinearcoefficientsandlinearbasesasexplainedbelow. Interpolatedkeytimesaresimilarlydefined as NumEXxamples NumXAdverbs Km(p)= rimRi(p)+ almAl(p): (4) i=1 l=0 For each verb there are (NumCP (cid:2)NumDOF) control point interpolations (eq. 3) and NumKeyTimes keytimeinterpolations(eq.4). This leaves us with the problem of choosing the specific shape of the radial bases and determining the linearandradialcoefficients. Wesolvetheseproblemsintwosteps,byfirstsolvingforthelinearcoefficients andthenfortheradialbasiscoefficients. 4.1 LinearApproximation Inthefirststep,wesolveforthelinearcoefficientsbyfindingthehyperplanethroughtheadverbspacethat bestfitsthevariationacrosstheexamplemotionsoftheselectedcontrolpointorkeytime. Thelinearbasis functionsaresimplyAl(p)=pl,thelthcomponentofp,andA0(p)=1. Anordinaryleastsquaressolution determinestheNumAdverbs +1linearcoefficients,ajkl,thatminimizethesumofsquarederrorsbetween NumXAdverbs ~b (p )= a A (p ); ijk i jkl l i l=0 andbijk,theactualB-splinecontrolpoint(orkeytime)beinginterpolated,wherepi istheadverbsettingfor theith examplemotion. Lettingbjk andb~jk denotevectorsofeachbijk(pj)and~bijk(pj)forafixedj and k,thelinearapproximationleavestheresiduals b(cid:22) =b −b~ : jk jk jk Itisthejoboftheradialbasistointerpolatetheseresiduals. 4.2 RadialBasisFunctions Wedefineoneradialbasisfunctionforeachexamplemotion. Theradialbasisfunctionsaresolelyafunction ofthedistance,di(p)=kp−pikbetweenapointintheadverbspace,p,andthepointintheadverbspace corresponding to example motion i, pi. The radial basis itself, Ri(p), has its maximum at pi (i.e., where 8 d = 0). We would also like the radial bases to have compact support (i.e., have value zero beyond some distance)tolimiteachexamplemotion’sinfluencetoalocalregionofadverbspace,thusallowingforlocal refinement of the verbs. There are a number of choices for the specific shape of the radial basis. For its combinationofsimplicityandC2 continuity,inthisworkwechosetousearadialbasiswithacrosssection ofadilatedcubicB-spline,B(d=(cid:11)). Thedilationfactor,1=(cid:11),ischosenforeachexamplemotiontocreatea supportradiusfortheB-splineequaltotwicetheEuclideandistancetothenearestotherexamplemotion. For (cid:11) = 1,thecubicB-splinehasaradiusof2.0,thus(cid:11)issimplytheminimumseparationtothenearestother exampleintheadverbspace. Giventhisdefinition,itisclearthattheexamplemotionsmustbewellseparated. Thecoefficients,rijk,cannowbefoundforeachDOFB-splinecontrolpointandkeytimebysolvingthe linearsystem, Dr =b(cid:22) jk jk whererjk isavectoroftherijk termsforafixedj andk,andDisasquarematrixwithtermsequaltothe valueoftheradialbasisfunctioncenteredonmotioni1atthelocationofmotioni2. Thus (cid:18) (cid:19) R (p ) D =B i1 i2 : i1;i2 i1 (cid:11) i1 5 Verb Graphs Inadditiontotheconstructionofindividualverbs,itisimportanttocombinethemsothatsmoothtransitions occur between verbs. To do so, an author builds a directed graph of verbs, or “verb graph,” in which the nodesrepresenttheverbsandthearcsrepresenttransitionsbetweenverbs. Iftherearemultipletransitionarcs leavingaverb,eachtransitionmaybegivena“likelihood”oftransitioning,usedtostochasticallychooseat runtimebetweenmultiplepossibletransitionsifnonehavebeenexplicitlyspecified. The adverbs are shared across verbs although each verb may or may not respond to each adverb; for example,anadverbforuphill/downhillmayhavenomeaningtoa“sit”verb. Theverbgraphisstatic,thatis, fixedatauthoringtime. 5.1 Transitions Givencorrespondingtimeintervals(assetbythedesigner)intwoverbs,transitionssmoothlymovecontrol fromoneverbtothenext. Forexample,intransitioningfromwalkingtorunning,thetimeintervalsmayboth besettospantherightfootplacement. AtransitionisamappingofsimilarsegmentsbetweentwoverbsAandB. Thecorrespondenceregion isdeterminedbythefourvariables,tA,tA,tB,andtB,thestartandstoptimesoftheregionineachofthe s e s e twoverbs. NotethatthesetimesareexpressedasgenerictimessincetheverbsAandB mayhavedifferent durationsbasedupontheircurrentadverbsettings. Inotherwords,thetransitionsaredesignedbasedonthe similarityofthestructureofthemotions(generictime)andsowillworkeventhoughtheverbsthemselves arechangingatruntime. Thedurationofthetransitioniscalculatedbytakingtheaverageofthelengthsofthetwoblendingregions (cid:0) (cid:1) (cid:0) (cid:1) T(tA)−T(tA) + T(tB)−T(tB) e s e s 2 9 q A (t) tA j e q B tA (t) s j tB tB s s Figure2: TransitionBlendingDuringCorrespondenceRegion where the T function maps generic time to real time (keytime time) for the verb’s current adverb settings. Transitions,astheyaremadeupofverbs,areaffectedbytheverb’sadverbsettingsandthereforetakeonthe mood,duration,andphrasingoftheirconstituentverbs. Spacetime transitioning mechanisms were discussed by the authors in [14]. Generation of spacetime transitionsbetweentwomotionsisstillanofflineprocess. Sincethespecificmotionstheverbsgenerateare not known until runtime, this method cannot be used here. Thus, in this work we will rely on a simpler formulationtoallowruntimecalculationofthetransitionsbetweenverbs. VerbsAandBaresimplyblendedbyfadingoutonewhilefadingintheother. Amonotonicallydecreasing blendingfunctionwitharangeanddomainof[0;1]determinestherelativecontributionofthetwoverbs. A sigmoid-likefunction,(cid:11) = 0:5cos((cid:12)(cid:25))+0:5isusedinthiswork. Overthetransitionduration,(cid:12)moveslinearlyfrom0to1representingthefractionofthewaythroughthe transitionintervalsineachverb. ThetransitionalmotionisdeterminedbylinearlyinterpolatingtheverbsA andBwithweights(cid:11)and1−(cid:11)respectively. TheinternalDOFsarefoundbyinterpolatingthejointpositions, asshowninFigure2,whichshowstheDOFfunction(cid:18)j asacombinationofthetwoDOFfunctions(cid:18)jA and (cid:18)B duringthetransitionregion. Thepaththejointtakesisdefinedby(cid:18)A beforethetransition,(cid:18)A;B during j j j thetransition,and(cid:18)B afterthetransition. SmoothmotionfortherootDOFsisachievedbyinterpolatingthe j velocities(ratherthanpositions)ofthetwoverbsandthenintegratingtheresultsthroughthetransition. 5.2 VerbGraphatRuntime Issuingcommandstothecreaturecontrolsthemovementfromverbtoverbintheverbgraph. Whendirected toperformaparticularverb, asearchisexecutedtodetermineasequenceoftransitionsandverbsthatwill reach the desired action from the one currently playing. The shortest path, where shortness is defined as the number of needed transitions, is chosen. This path through the verb graph is represented as a queue of transition,verb,transition,verb,andsoon. Some bookkeeping is required to keep the verb graph in a useful state. The motion of the root of the creaturemustbestoredandmaintainedateachtimestepinordertoreorientandrepositionthebaseverbsfor concatenationontothecurrentaction. Forexample,inawalktransitioningtoitself,thehorizontalposition specifiedbytheverbindicatesanoffsetfromwherethecreaturewaswhentheverbwasinvoked. Thus,the creaturecontinuestowalkforwardanddoesnotjumpbacktotheoriginoneachstride. Also,thesetofcurrent 10
Description: