EFFICIENTANIMATIONTECHNIQUESBALANCING BOTHUSERCONTROLANDPHYSICALREALISM ADISSERTATION ZichengLiu INCANDIDACYFORTHEDEGREE PRESENTEDTOTHEFACULTY OFDOCTOROFPHILOSOPHY OFPRINCETONUNIVERSITY RECOMMENDEDFORACCEPTANCE BYTHEDEPARTMENTOF COMPUTERSCIENCE November1996
ccopyrightbyzichengliu1996 AllRightsReserved
Tomywifeandmyparents iii
Abstract Specifyingthemotionofananimatedlinkedguresuchthatitachievesgiventasks aretwosourceswhichcontributetothecomplexityproblem:oneisthesymbolic growthascreaturesandtasksapproachthoseonewouldliketoanimate.there (e.g.,throwingaballintoabasket)andperformingthetasksinarealisticfashion (e.g.,gracefully,andfollowingphysicallawssuchasgravity)hasbeenanelusivegoal forcomputeranimators.thespacetimeconstraintsparadigmhasbeenshowntobea valuableapproachtothisproblem,butitsuersfromthecomputationalcomplexity processingoftheanimator'sconstraintsandtheobjectivefunctionsderivedfromthe physicalmodelsandthesecondliesinthenumericaloptimizationphase.thisthesis reportsonworktoenhancethespacetimeconstraintstechniquesbothsymbolically andnumericallytosignicantlyspeedupcomputations. evaluationschemesothatthetimerequiredforgradientcomputationwhichisneeded bythenumericaloptimizationisreducedfromexponentialgrowthtotheoptimal quadraticgrowth.furthermore,withthenewsymbolicmethod,alanguagedeveloped interface. forthesymbolicexpressionscanbeeasilyinput,thusitprovidesamoreconvenient Ourrstcontributionistodevelopanewsymbolicinterfacewitharecursive toprovidecontroloverthemotionandtoreducethecomplexityoftheoptimization problem.thismethodhastheadvantageofprovidingmuchoftheusercontrolofthe parameterswhichmaybelessintuitivefortheanimator,byusingoptimizationmethods.thenoveltyofthisapproachisthattheuser-speciedkeyframesareusedboth specifyafewkeyframeswhilelettingthecomputerdeterminethespeedandtiming, Secondly,wedevelopakeyframeoptimizationsystemwhichallowstheuserto iv
traditionalanimationsystemwhileprovidingthephysicalrealismoftheoptimizationbasedsystem.duetothereducedcomplexityoftheoptimizationproblem,the computationtimeisnearlyinteractiveforcomplexgures. thefunctionsthroughtimeofthegeneralizeddegreesoffreedomarereformulatedin ahierarchicalwaveletrepresentation.thisprovidesameanstoautomaticallyadd arisinginthespacetimeconstraintsformulationbyusingwavelets.inthisscheme, detailedmotiononlywhereitisrequired,thusminimizingthenumberofunknowns. Inaddition,theoptimizationproblemisbetterconditionedsothattheconvergence Finallywedevelopahierarchicalschemetosolvethenonlinearvariationalproblem isfaster. v
Acknowledgements researcherandanicepersontoworkwith.withouthisinspirationandconstant Firstofall,Iwouldliketothankmyadvisor,ProfessorMichaelCohen,forintroducing metotheareaofcomputeranimation,andadvisingmythesisresearchevenafter heleftprinceton.itisapleasureandhonortoworkwithhim.heisbothagreat encouragement,thisthesiswouldhavebeenimpossible. putergraphicsandfascinatingmewithbeautifulpicturesandanimations. AndrewYao,fortheirtimeandeortinreadingmythesisandtheirhelpfulcomments. ThankstoProfessorDobkinforhelpingmewiththenancialsupportaftermyadvisor leftprinceton.thankstoprofessorandrewyaoforteachingmethetechniquesin IwouldliketothankProfessorPatHanrahanforteachingmethebasicsofcom- theoreticalcomputerscience.hisclassisalwaysinspiring. Iwouldliketothankmythesisreaders,ProfessorDavidDobkinandProfessor yearsatprinceton. degreeincomputerscienceandrecommandingmetoprincetonuniversity. thehierarchicalspacetimecontrol.iwouldalsoliketothankchuckroseforwriting IwouldliketothankProfessorJin-YiCaiforsupportingmeduringmyrsttwo aninterfaceforthehierarchicalspacetimecontrolsystemwhichispartofthethesis. IwouldliketothankProfessorDing-ZhuDuforencouragingmetopursueaPhD ManythankstoStevenGortlerforhishelpinclarifyingthewaveletworkusedin behisocemate. dicultrstmonthsatprincetonwithoutitbeingadisaster.ifeelsofortunateto EMACS,andotherhackingtools.Hishelpmadeitpossibleformetogothroughthe easierandalotmorefun.iwouldliketothankmyocematestefanosdamianakis forteachingmethebasicsofcomputersystemsandhowtousexwindow,unix, ThankstoRichardAlpertforhisfriendshipandhelptomakemylifeinPrinceton vi
9296146. FinallyIwouldliketothankmywifeXueLiforherloveandsupport. ThisworkwaspartiallysupportedbyNationalScienceFoundationGrantCCR- vii
Contents Abstract Acknowledgements 1Introduction 1.1ConventionalAnimationandComputerAssistance...2 iv 1.2Interpolation...3 1.3LinkedFigures...4 vi 1.4DynamicSimulation...7 1.5Control...8 1 2Preliminaries 1.6SpacetimeConstraints...9 1.7InteractiveSpacetimeConstraints...12 1.8ScopeoftheThesis...12 1.9Contributions...13 2.1Coordinatesystemsandtransformationmatrices...14 2.2Rotationaboutcoordinateaxis...16 2.3Linkedgurestructure...17 2.4Kinematics...18 2.5Dynamics...20 14 2.6SpacetimeConstraints...22 2.7TheFiniteElementMethod...26 2.8CubicSplines...27 2.8.1HermiteSplines...28 viii
2.9Wavelets...31 2.10NonlinearOptimization...46 2.8.2UniformB-splines...29 2.9.1HaarWavelets...32 2.9.2B-splineWavelets...39 2.11InteractiveSpacetimeConstraintSystem...53 2.9.3B-splineWaveletsonaBoundedInterval...42 2.12Compilation,CommonSubexpressionElimination,andSymbolicDifferentiation...56 2.10.1UnconstrainedOptimization...46 2.10.2LineSearch...49 2.10.3ConstrainedOptimization...52 3EcientSymbolicInterface 2.13Summary...58 3.1Introduction...59 3.2TheLanguage...61 3.2.1Constants...63 3.2.2Variables...64 3.2.3Operations...65 3.3AnExample...67 3.4SymbolicDierentiation...69 3.5TorqueVariables...69 3.6Evaluation...73 3.7InteractiveSpacetimeConstraintsSystemwiththeNewSymbolicInterface...74 3.2.4RepresentingKineticEnergy...67 4KeyframeOptimization 3.8Experiments...75 3.9Conclusion...75 4.1Introduction...79 4.1.1TheIdea...79 ix
4.2SystemOverview...82 4.1.2ComparisontoStandardKeyframingandConstrainedOptimization...81 4.2.1HermiteInterpolationasDOFRepresentation...83 4.2.2RelaxingSpeedandTiming...83 5HierarchicalSpacetimeControl 4.3KeyframeOptimization...88 4.4Results...89 4.5Conclusions...92 RelaxingTiming...84 5.1Introduction...93 5.2HierarchicalB-splines...93 5.3Wavelets...95 5.3.1AdvantagesofWaveletstoSpacetimeAnimation...95 5.3.2QuadraticFunction...97 5.3.3ChoiceofWavelets...99 6ConclusionsandFutureResearch 5.4Implementation...100 5.5Results...102 5.6Conclusion...104 5.3.4Scaling...99 Bibliography 6.1Contributions...107 6.2FutureWork...108 107 110 x
ListofTables 1ComparisonoftheconvergencespeedsofusingHaarbwaveletbasis vs.usingboxbasis.eachentryw(l;k)representsthenumberoftimes among100teststhatthewaveletbasisisfasterthantheboxbasis..99 xi
ListofFigures 1Thebouncingballtrajectoriesunderlinearandcubicinterpolation.3 2Inversekinematicsandinterpolationoflinkedgures...5 3Thepathsofthepointmass...10 4X1andY1arerotatedbycounterclockwise...16 5Anexampleoflinkedgurestructure...17 6Computetransformationmatrices...19 7Computetherstorderderivativesofthetransformationmatrices..21 8One-linkarm...22 9TheHermitesplinebasisfunctionsover[0;1]...29 10TheuniformB-splinebasisfunctionsover[0;4]...30 11TwoscalerelationshipofHaarbasis...32 12TheHaarwaveletfunction 15FiveB-splinesL;jmaybecombinedusingtheweightshtoconstruct 13HaarbasisfunctionswhenL=3...36 14f(t)=22;0+22;1+42;2+2;3=2:250;0+0:25 16ElevenB-splinesL;jmaybecombinedusingtheweightsgtoconstruct (t)...33 17Linesearch:bisectionmethod...50 thedoublewidthb-splinel 1;0...40 thewaveletfunction L 1;0...40 0;0 1:51;1...37 18Linesearch:quadraticinterpolation...51 19TheInteractiveSpacetimeConstraintsSystem...54 20Thenumberofnodestobeevaluatedisgreatlydecreasedbycommon 21DierentiationRules(theunaryoperatorsarenotallenumeratedas subexpressionextraction.the\c"nodesrepresentthecosineoperator.55 manyaresimilar)...57 xii
22Theplanari-linkchain...60 23Theplanar3-linkchainthrowingabasketball...67 24Thenewinteractivespacetimeconstraintssystem...74 25ComparisonsofpreviousCSEmethodandthenewsymbolicmethod76 26Thegraphicalinterface...78 27Controlvs.Automation...80 28One-linkarmthrowingtheballintothebasket...84 29=(t)...85 30MotionsequencewhenT1=2:0andT2=1:5...86 31MotionsequencewhenT1=0:5andT2=0:5...87 32Motionsequences...90 33HierarchyofB-splineandWaveletBases...95 34ConvergenceofArmandBallexamplefor4dierentstartingtrajectories.Therstandfourthexamplesresultedinunderhandthrows,and therestoverhand.timeisinseconds,andthecostisaweightedsum ofconstraintviolationsandenergyabovethelocalminimum...103 35Aplanarthree-linkarmanda6DOFbasketballplayer...104 36Scenefromabasketballgame...105 37Thetwobasketballplayers...106 xiii
Chapter1 Introduction Animationoriginatedfromartistry.Itistheprocessinwhichartistsbringlifetotheir positioncanbeconsideredanimationsinceitgeneratesavisualchange. lifelessobjectssuchasowingwaterorarollingball.eventhechangeofacamera becausetheyexistonlyintheformofimages.whenspeakingofanimation,people usuallythinkofmotionoflifelikegures,butanimationalsocoversthemotionof virtualguresbyaddingmotion.waltdisney'sdonaldduckandmickeymouseare twowellknownexamplesofanimatedgures.theseguresaresaidtobevirtual animationandalleviatesomeoftheworkoftheartists. scienticresearch.movieshaveincreasedtheiruseofcomputeranimationincreatingspecialeects.thecartoonindustryisutilizinganimationsoftwarepackages toproducemorerealisticandcomplexmotionfortheircharacters.theknowledge scienticconceptsandvisualizeprocesseswhichcannotbeseenintherealworld. Flightanddrivingsimulatorsareusedtosafelytrainbeginnersforsituationswhich otherwisecouldnotbetaughtintherealworld.molecularsimulationtechniques andabilitytouseanimationsoftwarepackagesisbecomingmoreimportantfora professionalanimator'swork.ineducation,peopleuseanimationtodemonstrate Techniquesandtoolshavebeendevelopedinanattempttoautomatetheprocessof imation(orsimplyanimation)hasbecomeanactiveeldforcomputerscientists. Computeranimationiswidelyusedinentertainment,education,trainingand Withthedevelopmentofcomputertechnologyinthepastdecade,computeran- 1
CHAPTER1.INTRODUCTION haveallowedscientiststoviewmolecularinteractionsandtoperformexperimentsin avirtualmolecularworld. Theworkpresentedinthisthesis,however,willfocusprimarilyonanimating 2 linkedguresrepresentinganimatecreatures. 1.1ConventionalAnimationandComputerAssistance thefollowingstepsasdescribedin[9,22].first,astoryboardislaidout,consisting Conventionalanimationisafairlyroutineprocess.Generallyspeaking,itconsistsof ofasequenceofskeletaldrawingswhichoutlinesthewholestory.eachsketchinthe sequencerepresentsasegmentinthewholestory.thenforeachsegment,certainkey framesaredrawn.eachkeyframecorrespondstoascenewherethecharactersor sceneswheretheballisonthegroundoratitsmaximalheightcanbeusedaskey otherobjectsareattheirextremeorcharacteristicpositionssothattheintermediate positionscanbeinferred. frames,andtheotherintermediateframescanbeinferredfromthesepositionsbased onthefactthattheballisinbetweentheseextremepositions. Forinstance,ifasegmentrepresentsthemotionofabouncingball.Thenthose buildings,desks,pipes,etc.computerscanalsobeusedforimagecompositionsuch iscalledkeyframeanimation. computer.computersaregoodfordrawingobjectswithregulargeometrysuchas inbetweening).becauseoftheuseofkeyframesandinbetweening,thistypeofmethod Manyofthetasksinconventionalanimationcanbeperformedorassistedbythe Thentheintermediateframesarelledinbytheanimatororanassistant(called asblendingthebackgroundandforeground. taskisparticularlyinterestingforthetopicofthisthesissinceitaectstheappearance ofthemotion.thekeyframesonlydeterminetheskeletonofthemotion,while detailsofthemotionlargelydependontheinbetweening.inbetweeningisessentially amultidimensioninterpolationproblem. Inbetweeningisanothertaskinwhichthecomputercanprovideassistance.This
CHAPTER1.INTRODUCTION 3 1.2Interpolation Toillustratetheideaofinterpolation,let'sconsiderthebouncingballasanexample. AsinFigure1,assumingtheballisontheoorA=(x0;y0)attimetime0and Figure1:Thebouncingballtrajectoriesunderlinearandcubicinterpolation bouncedtothehighestpositionb=(x1;y1)attime1,wewanttodeterminethe positionoftheballatanyintermediatetimetwhere0<t<1.thesimplestsolution respectively.theballgoesstraightfromatobwithauniformvelocity.theresulting wouldbetousealinearfunctiontointerpolatethetwopointsaandb,thatis, motiondoesshowtheballgoingupwardafterbouncing,butdoesn'treecttheeect Figure1(A)showsthepositionsoftheballattime0,0.2,0.4,0.6,0.8,and1.0, y=y0+t(y1 y0) x=x0+t(x1 x0) ofthegravity,andasaresult,themotiondoesn'tlookrealistic. (1) Itturnsoutthatgiveny(0),y(1),_y(0)and_y(1),thereisauniquecubicpolynomial y=a0+a1t+a2t2+a3t3whichsatisesallofthe4conditions.(suchpolynomials suchthat_y(t)(thederivative)is0whent=1,aswellasy(0)=y0andy(1)=y1. whentheballisatitshighestpositionb.sowecantrytondafunctiony=y(t) performingtheinterpolation.weknowthattheverticalvelocityoftheballiszero Aremedyforthisproblemwouldbetotakeintoconsiderationthevelocitieswhen arecalledhermitepolynomials,anditsconstructionisdescribedinsection2.8.1). y A B (A): Linear interpolation t y A B (B): Cubic interpolation t
CHAPTER1.INTRODUCTION Inthisexample,wedonotknow_y(0),butgiventheheighttheballiesplusgravity thiscanalsobesolvedfor.figure1(b)showsthepositionsofballattime0,0.2, 0.4,0.6,0.8and1.0byusingthecubicpolynomialastheinterpolationfunction.We 4 sothatthemotioninbetweenthekeyframesdoesnotvarytoomuch.forexample, able.second,thetimeintervalbetweentwoconsecutivekeyframeshastobesmall ifwechoosethetwokeyframeswheretheballisatitshighestpositionsandskipthe Firsttheuserhastosupplythevelocitiesatthekeyframeswhichmaynotbeavail- canseethatthemotionlooksmorerealistic. onewheretheballisontheoor,thenintheinterpolatedmotion,theballwould Therearestilltwoproblemsingeneralwiththecubicpolynomialinterpolation. determinethecongurationsandperhapsvelocitiesoftheobjectsorguresatthese ystraightforwardhorizontallyandtherewouldbenobouncingmotionatall.in 1.3LinkedFigures keyframeswhichmayrequirealotoftrialanderror. practice,morekeyframesmeansmoreworkfortheanimator,sincehe(she)hasto aretheindependentparameterswhichcompletelydetermineitsconguration.for example,aplanarthreelinkarmasshowninfigure2(a)has3degreesoffreedom, sincethe3angles0,1,and2completelydeterminethecongurationofthelinkage. Alinkedgureconsistsofrigidlinksconnectedbyjoints.Humanbeingsandanimals areexamplesoflinkedgures.thegeneralizeddegreesoffreedomofalinkedgure thecoordinate(x,y)oftheendeectorisequaltothatofa.tosolvesuchaninverse determinethecongurationofthethreelinkarmsuchthattheendeectorreaches pointa(seefigure2(b)).weneedtondthethreeangles0,1,and2sothat aproblemiscalledinversekinematicsproblem.forexample,supposewewantto miningtherotationalanglesgivenadesiredlocationfortheendofthelinkage.such Forlinkedgures,thetaskofdeterminingthecongurationofteninvolvesdeter- describedinsection2.4. kinematicsproblem,wecanwritedowntheequationswhichrelateendeectorpositionstorotationalangles.theseequationsarecalledkinematicsequationsandare
CHAPTER1.INTRODUCTION 5 end effector L 3 θ 2 A L 2 θ 1 L 1 θ 0 (A) (B) E B Figure2:Inversekinematicsandinterpolationoflinkedgures E B A A solutionmaynotbewhatwewant.forexample,ifwearesimulatingahuman y=y(0;1;2):thentheproblembecomessolvingthesystemofnonlinearequations. solutionisnotunique(figure2(b)showstwosolutions).ingeneral,anarbitrary (C) (D) being'sarm,wemaywanttoputsomelimitsonthethreejointangles(suchasthe Forthisexample,wecanwritedownequationsoftheformx=x(0;1;2)and E linear interpolation three angles of A and B. three linearly interpolated from elbowshouldnotbendbackward).jointlimitconstraintsareinequalityconstraints, Ingeneral,therearemoreunknownsthanthenumberofequations,sothatthe angles found by inverse initial and final kinematics solver. configurations. thus,theinversekinematicsproblemwithjointlimitconstraintsbecomesasystem ofnonlinearequationsandlinearinequalities.
CHAPTER1.INTRODUCTION systemofnonlinerequationsandlinearinequalities.theyshowedthattheirinverse kinematicssolverachievesnearlyinteractivespeed(inafewseconds)forfairlylarge ZhaoandBadler[57]usedRosen'sprojectedgradientmethod[21]tosolvethe 6 gures(withupto30degreeoffreedoms).theirtechniqueshavebeenusedincommercialanimationsystemssuchasthosefromsoftimage,alias,andwavefront. onecanndthepositionoftheendeectorbylinearinterpolation.thenonecan problemwiththisapproachisthatthejointanglesmaynotbeacontinuousfunction consideraplanarthreelinkarmmovinganobjectfrompositionatopositionb(see Figure2(C)).Intherstapproach,tondthecongurationatagiventimepoint, applytheinversekinematicssolvertondthejointangles(seefigure2(c)).one Forlinkedgures,interpolationbecomesmorecomplextoo.Asanexample, oftime.toseewhy,noticethattheinversekinematicssystemhasmultiplesolutions sothatthesolutionsfoundbytheinversekinematicssolveratconsecutivetimepoints maynotbeconsistent.forexample,infigure2(b),ifatpositiona,theinverse kinematicssolvergivesthesolutionasdrawnwiththesolidline,butatthenext isnotclearhowtondatrajectoryoftheendeectorrstsothatthemotionlooks positionwhichisclosetoa,givesasolutionclosetotheotheroneasdrawnwiththe realistic. isthatinsomecases,arealistictrajectoryoftheendeectormaybediculttond. Forexample,ifinsteadwewantthethreelinkarmtothrowaballintoabasket,it dashedline,thenthetwosolutionsarenotconsistent.asaresultofsuchinconsistent solutions,theresultingmotionwouldhavesuddenchanges(jumps).anotherproblem ofthemiddlecongurationarelinearlyinterpolatedfromthejointsoftheinitialand nalcongurations).thismethodhastheadvantagethattheangleswillbecontinuous,thusthemotionhasnojumps.but,thedicultissuesremainofhowtoachievrectly.onecanndafewkeycongurationsofthemotionaskeyframes,then interpolatethejointanglestoobtainthemotion.(infigure2(d),thejointangles Anotherapproachforinterpolationwouldbetointerpolatethejointanglesdi- motionrealismaswasdiscussedinsection1.2.
CHAPTER1.INTRODUCTION 1.4DynamicSimulation Notsurprisingly,dynamicsimulationisaneectiveapproachtoachievemotionrealism.Forthebouncingballexample,themotionoftheballafterbouncingcan7 beeasilycomputedbyusingnewton'slaw.ingeneral,asimulationproblemisan theresultingmotionlooksrealisticsincethemotionobeysphysicallaws.sofar,this approachhasbeenusedtosuccessfullycreatmotionsofchains,bowling,pool,waves, snakes,automobiles,etc[2,3,6,27,30,31,36,41,44,55,10,42]. andtheinitialcongurationandvelocitiesaretheinitialconditions.thesolution initialvalueproblem([19])wherethedierentialequationsdescribethephysicallaws totheinitialvalueproblemisthemotion.theadvantageofthisapproachisthat themotiononcetheinitialconditionsarespecied.thereforeitisdiculttocreate motionswithsomedesiredgoals.forexample,onecanusedynamicsimulationto generateaphysicallycorrectrotationmotionofagureskaterintheairiftheinitial (attakeo)velocitiesaregiven(bothrotationalvelocityandthevelocityofcenterof gravity).buttoguaranteethattheskatercompletesthedesirednumberofrotations Oneproblemwiththesimulationapproachisthattheuserhasnocontrolover intheair,theanimatorhastondthecorrectinitialvelocities.themathematicalmodelofsuchacontrolproblemisaboundary-valueproblem[19]whichusually requiresmoreelaboratesolutionmethodsthantheforwardsimulationapproachfor solvinginitialvalueproblems[48]. doesnotaddress,namely,howtodeterminetheinternalforces(whicharefunctions overtime).linkedguresareusuallyautonomous,thatis,theycanexertforces whetherthegoalisreachedornot.thus,forlinkedgures,themotioncontrol ortorques.theinternalforcesaecttheappearanceofthemotionanddetermine problembecomesndingtheinternalforcessothatthegoalisreachedandthemotion Foranimatelinkedgures,thereisanotherproblemwhichthesimulationapproach looksrealistic. includingtheworkreportedinthisthesis.inparticular,thisthesisconcentrateson theproblemofhowtogenerategoaldirectedmotionforlinkedgures.beforewe describeourwork,let'sbrieyreviewsomeoftheworkwhichhasbeendoneinthis direction. Howtogaincontroloveradynamicsystemhasbeenthefocusofmanyresearchers
CHAPTER1.INTRODUCTION 1.5Control Oneapproachtogaincontroloveradynamicsystemistodesigncontrollers.A controllerisaspecicationofforcesortorquesasfunctionsofthepositionsand8 state,themotioncanbecomputedbyintegratingovertime.forexample,consider aparticlewithunitmassatinitialpositionx=x0andvelocity_x=0.wewant toapplyaforceftobringittorestatpositionx=0.intuitively,wewouldlike velocities(calledthestate)ofanobjectorgure.givenacontrollerandtheinitial becomes velocity,whichleadstoacontrollerofthefollowingform: wherek1andk2arepositiveconstantstobedetermined.nowthemotionequation toapplyaforcewhosedirectionisoppositetothedirectionofthedisplacementand f= k1 k2_ x= k1 k2_ (2) ank2sothatk2>4k1,thesolutionwillhavetheform: detaileddiscussionisomittedhere.wejustwanttopointoutthatifwechoosek1 rameters)andseeifwecanndthedesiredk1andk2sothatthegoalissatised.a Wecanthensolvethisdierentialequation(thesolutioncontainsk1andk2aspa- (3) wherec;c2;w1;w2aresomeconstantswithw1>0,w2>0.clearlybothxand_x solutions. tendto0astgoestoinnity.althoughinpractice,tcanneverbecomeinnity,but whentisbigenough,bothxand_xwillbecomeverysmallsothattheyareacceptable x=c1e w1t+c2e w2t ofavarietyofsimulatedandrealcreatures[51].morerecently,hodginsandher colleagueshavedevelopedcontrollerstoproduceavarietyofathleticmotions[28]. Controllersareusedtoregulatespeedandgait,maintainbalance,etc.However,each trollers,andthemotionisthesolutionstoasequenceofoptimalcontrolproblems. Raibertandhiscolleagueshavedesignedcontrollerstoproducerunningmotions BrotmanandNetravali[7]useanoptimalcontrolformulationtodenetheircon- newmotion(e.g.adierentnumberofrotationsindiving)wouldrequiredesigning
CHAPTER1.INTRODUCTION anewcontrollerandthemotionhastobetunedmanuallyinordertocreatethe desiredbehavior.boththedesignofacontrollerandthene-tuningaretedioustasks. Systematicwaysneedtobedevelopedforsuchmethodtobeusefulinpractice. 9 controllertorepresentmotionwithanarrayofstimulus-response(sr)parameters touseparameterizedcontrollerstorepresentmotionwhiletheparametersarefound throughanoptimizationprocess[54,43].ngoandmarksuseastimulus-response asunknowns[54].vandepanneandfiumeuseasensor-actuatornetworkwith weightedconnectionsasthecontrollertorepresentmotionwiththeweightsasunknownparameters[43].giventhevaluesofthesrparametersorweightsineither ofthesetwomethods,themotionisgeneratedbyforwarddynamicssimulation.the Toautomatetheprocessofndingcontrollers,techniqueshavebeendeveloped controloverthemotionisrealizedbyspecifyingaperformancefunctionwhichisa mixtureofsomeobjective(e.g.,maximizingthedistancetobetraveled)andsome whichwecansimulate.agoodexampleisthatsuchsystemcaneasilygeneratemotionswithcontactandcollisionwhichthetrajectorybasedapproach,asdiscussedin theresultingmotionisalwaysphysicallyplausibleanditcangenerateanymotions resultingmotionhasthemaximumscore.theadvantageofsuchmethodsisthat constraints(e.g.,theguredoesn'tfall)inapenaltyfunctionform.theparametersorweightsmustbefoundbyusingsomenumericsearchalgorithmssothatthe thenextsection,hasdicultytodealwith.thedisadvantageofbothmethodsis goaldirectednature. thedicultyofsearch.sinceitisnotclearhowtocomputegradients,thesearchs objectivesaresetsuchastomaximizethedistancetraveled.theresultingmotions usuallyhaveconvincingcontactsandcollisionsbutmaynothavegracefulnessanda usuallyhaveabruce-forcenature.withsucharudimentarysearchstrategysolving aconstrainedoptimizationproblemisexpensive.inpractice,usuallyonlysimple example,supposeapointwithunitmass,initiallyatrestatpositionx=0,isrequired 1.6SpacetimeConstraints Anotherapproachtogaincontrolistorepresenttheuser'sgoalsasconstraints.For
CHAPTER1.INTRODUCTION 10 toreachpositionx=1withvelocity_x=10attimet=1.theinitialandnal conditionscanberepresentedasthefollowingconstraintequations: Figure3:Thepathsofthepointmass Togetherwiththedynamicequationf=x,weobtainasystemofequations: _x(0)=0 _x(1)=10 (4) rectlytothepositionx=1withthedesiredvelocity.forinstance, Intuitively,onecaneasilythinkofasolutionsuchthatthepointacceleratesdi- _x(0)=0 _x(1)=10 (5) ofthispointasahammer,theninordertohitsomethinghard,amorenatural issuchasolution.figure3(a)isaplotofthetrajectoryx=x(t). Butthissolutionisnotthemostnaturallylookingsolution.Why?Ifwethink f=8<:10=9;t2[0;9=10] 90;t2[9=10;1] (6) x(t) 1.0 0.8 0.6 0.4 0.2 0.0 0.0 0.2 0.4 0.6 0.8 1.0 t (A) x(t) 1.0 0.5 0.0-0.5-1.0 0.0 0.2 0.4 0.6 0.8 1.0 t (B)
CHAPTER1.INTRODUCTION andecientwaywouldbetoswingthehammerbackwardrsttogainenoughspace foracceleration.thereasonwhythiswayismoreecientisbecauseitrequires lesspower.thissuggestsustondthesolutionwithminimumamountofforces. 11 is,wehavethefollowingformulation: Mathematicallywecanminimizetheintegralofthesquareofforcesovertime,that MinimizeRf2dt s:t Thistypeofoptimizationproblemwheretheunknownsarefunctionsiscalled f _x(0) _x(1) =x =0 =10 (7) avariationalproblem[19].itturnsoutthisparticularproblemhasananalytical motion. Figure3(B)isaplotofthetrajectory.Wecanseethatthepointgoesbackwardrst andthenacceleratestothedesiredvelocity,whichisasmootherandmorenatural solution[19]: Theideaofndingthemotionwhichminimizessomesmoothnesscriteriasuchas x= 7t2+8t3: (8) themotion.forexample,minimizingtheintegralofforcesasintheaboveexample Kass[56],andthemethodiscalledthespacetimeconstraintsmethod. asthedynamicequations.anobjectivefunctionisoptimizedtocontrolthestyleof timecourseincludingtheinitialandnalconguration,thegoalconstraints,aswell tominimizethetotalforcesasintheaboveexamplewasproposedbywitkinand resultsinagracefulmotion,whileaminimumtimeobjectivefunctionwouldresult inarushedmotion. Inthespacetimeconstraintsformulation,theusercansetupconstraintsoverthe (DOF)functions(trajectories).Numericaltechniquescanbeusedtosearchforthe trajectorieswhichsolvetheoptimizationproblem,asdescribedbrieyinthenext sectionandinthenextchapterwithmoredetail. Theunknownsofaspacetimeconstraintsformulationarethedegreeoffreedom
Thespacetimeconstraintsformulationleadstoanonlinearconstrainedvariational CHAPTER1.INTRODUCTION 1.7InteractiveSpacetimeConstraints problem,thatingeneral,hasnoclosedformsolution.inpractice,thesolutionis 12 linearcombinationofbasisfunctionssuchascubicb-splines.thisresultsinarelated constrainedoptimizationproblem(i.e.,optimizingthecoecientstocreatemotion curvesforthedofthatminimizetheobjectivewhilesatisfyingtheconstraints). carriedoutbyreducingthespaceofpossibletrajectoriestothoserepresentablebya Unfortunately,generalsolutionstosuchanonlinearoptimizationproblemarealso unknown. methodovercomessomeproblemsinthepreviousspacetimeconstraintsystemas attentiononsubsetsorwindowsinspacetimetoperformlocalrenement.this systemusingahybridsymbolicandnumericalprocessingtechniques[13].inthis system,theusercaninteractwiththeiterativenumericaloptimizationandcanguide theoptimizationprocesstoconvergetoanacceptablesolution.onecanalsofocus Observingsuchadiculty,Cohendevelopedaninteractivespacetimeconstraints problemsisthecentralfocusoftheresearchasreportedinthisthesis. 1.8ScopeoftheThesis proposedbywitkinandkass.butsomecomputationaldicultiesstillremain,most Thisthesisconcentratesonthegoaldirectedanimationoflinkedgures.Webelievethatapracticalanimationsystemmusthavethefollowingproperties.First,it notablyasthecomplexityofthecreatureoranimationincreases.addressingthese theanimationsystemisproductive.whilespacetimeconstraintssystemdoprovide physicalrealismsandsomeusercontrol,theyhavebeencomputationallyexpensive. mustgeneraterealisticmotionsbyincorporatingdynamicsintothesystemtosave Howtoimprovethespacetimeconstraintsmethodtoachieveeciencyisthecentral animatorsothattheanimatorcancreatemotionswhichperformthedesiredtaskor achievethedesiredgoal.finally,itachievesinteractivecomputationspeedsothat theanimatorfromtedioustrialanderror.secondly,itmustprovidecontroltothe author[40,39,38]. focusofthethesis.mostoftheresultsreportedherearealsofoundinpapersbythe
CHAPTER1.INTRODUCTION 1.9Contributions Ourrstcontributionistodevelopanewsymbolicinterfacewitharecursiveevaluationschemesothatthetimerequiredforgradientcomputationwhichisneededbythe 13 numericaloptimizationisreducedfromexponentialgrowthtotheoptimalquadratic methods.thenoveltyofthisapproachisthattheuser-speciedkeyframesareused ingparameters,whichmaybelessintuitivefortheanimator,byusingoptimization face.secondly,wedevelopakeyframeoptimizationsystemwhichallowstheuser tospecifyafewkeyframeswhilelettingthecomputerdeterminethespeedandtim- symbolicexpressionscanbeeasilyinput,thusitprovidesamoreconvenientinter- growth.furthermore,withthenewsymbolicmethod,alanguagedevelopedforthe theoptimizationbasedsystem.duetothereducedcomplexityoftheoptimization problem,thecomputationtimeisnearlyinteractiveforcomplexgures.finallywe controlofthetraditionalanimationsystemwhileprovidingthephysicalrealismof developahierarchicalschemetosolvethenonlinearvariationalproblemarisinginthe bothtoprovidecontroloverthemotionandtoreducethecomplexityoftheoptimizationproblem.thismethodhastheadvantageofprovidingmuchoftheuser spacetimeconstraintformulationbyusingwavelets.theadvantageofthewavelet cessing,optimizedkeyframes,andhierarchicalwaveletbasis.finallyweconcludeand representationistwofold.first,theoptimizationproblemisbetterconditionedso discussfutureresearchideasinchapter6. thattheconvergenceisfaster.secondly,thenumberofunknownsisminimizedso thateachiterationtakeslesstime. groundandnotationinchapter2.chapter3through5describethesymbolicpro- Therestofthethesisisorganizedasfollows.Weprovidesomenecessaryback-
Chapter2 Preliminaries Inthischapter,wegivethenecessarybackgroundandnotationswhichwillbeused throughoutthisthesis.foramoregeneraltreatmentoflinkedguremodeling,kinematics,anddynamics,thereaderisreferredto[14,20,17].fletcher[21]givesan excellentintroductiontovariousoptimizationmethods. 2.1Coordinatesystemsandtransformationmatrices system=(x;y;z;o),foranypointp,thereexistthreerealnumberspx,py,and andz,thenthecoordinatesystemisdenotedtobe(x;y;z;o).givenacoordinate pendicularunitvectors.ifwedenotetheorigintobeoandthethreeaxistobex,y Eachcoordinatesystemconsistsofanorigin,andthreeaxiswhicharemutuallyper- The3Dcolumnvector0B@px pzsothat thecoordinatesystem,andisdenotedbyp.similarly,foreachvectorv,there P=O+pxX+pyY+pzZ: py pz1caiscalledthecoordinateofthepointpwithrespectto (9) existthreerealnumbersvx,vy,andvzsothat V=vxX+vyY+vzZ: 14 (10)
CHAPTER2.PRELIMINARIES 15 The3Dcolumnvector0B@vx vy vz1ca,denotedbyv,iscalledthecoordinateofthevector Vwithrespecttothecoordinatesystem. Giventwocoordinatesystems1=(X1;Y1;Z1;O1)and2=(X2;Y2;Z2;O2). The33matrix(X2 1;Y2 1;Z2 1)iscalledtherotationmatrix(alsoorientationmatrix) of1withrespectto2,andisdenotedbyr2 1.The44matrix,W2 1, 0@R2 1O2 1 011A (11) iscalledthehomogeneoustransformationmatrix(orsimplytransformationmatrix) of1withrespectto2.from(10),wehave V2=R2 1V1; (12) andfrom(9),wehave 0@P2 11A=W2 10@P1 11A: (13) Foranycoordinatesystem,thevector 0@P 11A iscalledthehomogeneouscoordinateofthepointpwithrespectto.wewillalso useptodenoteitshomogeneouscoordinatewherethereisnoconfusion. Foranycoordinatesystem,since X1=R2X2 1; Y 1=R2Y2 1; Z1=R2Z2 1; (14) wehave R1=R2R2 1: (15) Furthermore,from(9), O1=O2+R2O2 1: (16)
CHAPTER2.PRELIMINARIES 16 Therefore W1=W2W2 Figure4:X1andY1arerotatedbycounterclockwise andp=w2p21p1 GivenanypointP,since P=W1P1 =W2W2 1: (17) sop2=w2 (18) 1P1 (19) 2.2Rotationaboutcoordinateaxis Givenacoordinatesystem1=(X1;Y1;Z1;O1),let'srotateitaroundZ1and (20) denotetheresultingcoordinatesystemas2=(x2;y2;z2;o2).noticethatz2=z1 ando2=o1.tocomputex2andy2,wecanseefromfigure4that Y2= sin()x1+cos()y1 X2=cos()X1+sin()Y1 (21) (22) Y 2 θ Y 1 X 2 θ X 1 θ
CHAPTER2.PRELIMINARIES 17 L θ Therefore, Figure5:Anexampleoflinkedgurestructure 2 2 Q L 2 1 θ 1 L 0 Q 1 θ 0 Q WecallthismatrixtherotationmatrixaroundZ-axis,anddenoteitby<z().SimilarlywecanderivetherotationmatricesaroundXandY-axisas R1 2=0B@cos() sin()0 sin()cos()0 0 L the base. L 0 0 has child L 1. L 1 has child L 2. L 0 rotates about joint Q 0, L 1 rotates about joint Q 1, and L 2 rotates about joint Q 2. <y()=0b@cos()0sin() <x()=0b@10 00cos() sin() 10 0 Figure5).Eachlink,exceptone,hasaparentandandcanrotatearounditsparent 2.3Linkedgurestructure Throughoutthisthesis,weassumethegurestructureisatreeofrigidlinks(See 0 0 11CA (23) sin()0cos()1ca; 0sin()cos()1CA: (25) (24)
jointcanhave1to3degreesoffreedomandweuseeulerangles(rotatedaroundz, Y,andXsuccessively)torepresenttherotationanglesateachjoint.Givenagure, CHAPTER2.PRELIMINARIES aboutajoint.thespeciallink,whichdoesn'thasaparent,iscalledabase.each 18 oflinki.denoteqitobethejointwhichconnectslinkiwithitsparent. labelofitsparent.andweused(i)todenotethesetofthelabelsofallthechildren wherethelabelingordersarearbitrary.foreachlinki,weusethe}itodenotethe welabelthelinksasl0,l1,...,andln 1andthejointanglesas0,1,...,andm 1, originofthislocalcoordinatesystemisatthejointwhichconnectsthislinktoits 2.4Kinematics Eachlinkisattachedtoalocalcoordinatesystemwhichrotateswiththelink.The parent. notationsforhomogeneoustransformationmatrices. totheworldcoordinatesystem.andweuserjitodenoterj PitodenotePi.WeuseRitodenoteRi,therotationmatrixoflinkiwithrespect linki.wealsoassumethereisaxedworldcoordinatesystem,denotedby.for anypointp,wewilluseptorepresentpwhenthereisnoconfusion.andweuse Fortherestofthischapter,weuseitodenotethelocalcoordinatesystemof havethesameorientationastheworldcoordinatesystem.nowlet'sseehowto computethetransformationmatricesofthesecoordinatesystemsasfunctionsofthe rotationalangles.tocomputer}i Weassumethatwhenalltherotationalanglesare0's,allthecoordinatesystems i,i.e,thetransformationmatrixoflinkiwith i.wewillusesimilar respecttothecoordinatesystemofitsparent}i,noticethatriisobtainedbythe Z-axisbyiz,thenrotatearoundY-axisbyiy,andnallyrotatearoundX-axisby ix.sowehave Therefore followingprocess.startwiththesameorientationas}i,thenrotateiaroundits Ri=R}i<z(iz)<y(iy)<x(ix) R}i i=<z(iz)<y(iy)<x(ix) (26) (27)
CHAPTER2.PRELIMINARIES voidtransmatrices(inti/*thecurrentlink*/) fw}i i=<z(iz)<y(iy)<x(ix) 19 gforallj2d(i) if(iisthebase) elsewi=w}iw}i transmatrices(j); i Figure6:Computetransformationmatrices i Thehomogeneoustransformationmatrixis NoticethatQ}i011A: Inthecasewhenlinkiisabase,wesimplyhave W}i Ri=<z(iz)<y(iy)<x(ix): i=0@r}i iq}i i (28) thealgorithminfigure6. transformationmatriceswiforallthelinks,wecandoarecursivetreetraversalusing ForanypointPwhichisxedonlinki,itscoordinatewithrespecttotheworld iisconstantsinceqiisaxedpointonthelink}i.tocomputethe (29) coordinatesystemcanbecomputedfromitslocalcoordinatepiasthefollowing NoticethatPiisconstantsincethelinkisrigid,thusthevelocityofPis SinceWi=W}iW}i P=_Wi_ P=WiPi: _ Pi: (30) _Wi=_W}iW}i i+w}i_w}i i,wehavei: (32) (31)
CHAPTER2.PRELIMINARIES From(29)andrecallingthatQ}i _W}i i=0@_r}i 001A: i0 iisconstant,wehave (33) 20 Andthederivativesof<z,<y,and<xare Dierentiating(27),weobtain _<z()=0b@ sin() cos()0 _R}i i=_<z(iz)<y(iy)<x(ix)+<z(iz)_<y(iy)<x(ix)+<z(iz)<y(iy)_<x(ix):(34) _<y()=0b@ sin()0cos() cos()0 sin()1ca_; 0cos() sin()0 000 01CA_; (36) (35) and_<x()=0b@00 Figure7). Similarlyallthederivatives_Wicanbecomputedbyarecursivetreetraversal(see 0 sin() cos() 0cos() sin()1ca_ 0 (37) 2.5Dynamics ForeachpointPwithlocalcoordinatePi=0B@xyx1CA;consideraninnitelysmallcube bethemassdensityofthelinkiwhichmaybeafunctionofthepositioninthislink. Inthissection,weshowhowtocomputeLagrangiandynamics. atthispointwithedgelengthsdx;dy;anddz,respectively.thenthekineticenergy Firstlet'sseehowtocomputethekineticenergyoflinki.Denotei(x;y;z)to ofthispieceisapproximately0:5i(pi)dxdydz_ PT_ P.By(31),_ P=_WiPi.Denoting
CHAPTER2.PRELIMINARIES voidtransmatricesdot(inti/*thecurrentlink*/) fcompute_w}i 21 else_wi=_w}iw}i if(iisthebase) iusing(33-37) i Figure7:Computetherstorderderivativesofthetransformationmatrices gforallj2d(i) transmatricesdot(j); i+w}i_w}i i X=0@Pi weobtainthekineticenergyoflinki Ei=0:5ZXT_WT 11A,theenergybecomes0:5i(x;y;z)X_WT i_wixidxdydz i_wixdxdydz.integratingthis, thislinkwithrespecttothelocalcoordinatesystem. wherex=(x;y;z;1)trangesoverthehomogeneouscoordinatesofallthepointsin thediagonalelementsofm.noticethatforanycolumnvectory,wehave GivenasquarematrixM,lettr(M)denotethetraceofM,i.e.,thesumofall (38) Therefore YTY=tr(YYT): Ei=0:5Rtr(_WiXXT_WT =0:5tr(_WiJi_WT =0:5tr(_WiRXXTidxdydz_WT i); i)idxdydz (40) (39) linkbeingattached. localcoordinatesystem.noticethatallthecomponentsofjiareconstantssince theyonlydependonthegeometryandmassdistributionoflinki.andtheycanbe computedoncethelinkedgureisgivenwiththelocalcoordinatesystemsforeach whereji=rxxtidxdydzistheinertialtensoroftheithlinkwithrespecttoits
CHAPTER2.PRELIMINARIES 22 From(40),wehave @j=0:5tr(@_wi @jji_wt Figure8:One-linkarm @_j=0:5tr(@_wi @_jji_wt @jji_wt i+_wiji@_wt i+@wi @jjiwt @j) @_j)=0:5tr(@wi ii+wiji@wt @jji_wt @j+_wiji@_wt ii+_wiji@wt @j) i@j)(42) i (41) Soddt@Ei @_j @Ei @j=0:5tr(@wi @jjiwt i+wiji@wt @j)=tr(@wi i @jjiwt i) (43) vectorofthecenterofmassofthelinki,andg=(0;9:8;0)isthegravityvector.so ThepotentialenergyduetogravityisPi=miGWiri;whereriisthecoordinate ddt@pi @_j @Pi @j= mig@wi @jri (44) ThereforebyLagrangianequation[32],thegeneralizedforcewithrespecttojis fj=ddt@(ei Pi) @_j @(Ei Pi) @j=nxi=1[tr(@wi @jjiwt i)+mig@wi @jri] (45) 2.6SpacetimeConstraints Todemonstratetheideaofspacetimeconstraints,let'sseeanexample.Supposewe haveaonelinkarmwithonerotationaldegreeoffreedomaroundthezaxis(see (46) Y Ω Y 0 Ω 0 L Q 0 ball (in hand) θ H X X 0 B basket
CHAPTER2.PRELIMINARIES Figure8).Therectanglerepresentsthearm.Thecirclerepresentsaball.Letbe therotationalangleofthearmwithrespecttothexaxisinthecounterclockwise direction. 23 straightdownposition(= 2)attimet0,throwsaball(ofnegligiblemass)attime t1,andnallycomesbacktothestraightdownpositionattimet2.therequirement isthattheballisinthehandfromt0tot1,thenisinfreeightfromt1tot1+t,and attimet1+ttheballiscoincidentwithabasketwhichisthepositionbasshown infigure8. Supposewewanttoanimatethefollowingmotionsequence.Thearmstartsina andendingconditions,goalrequirement,andsomelimitsonthephysicalparameters oftheguresuchasjointangles,torques,etc. downposition.sowehavethefollowingequations: Thespacetimeconstraintmethodstartsbyspecifyingconstraintsincludingstart Inthisexample,thestartandendingconditionsarethattheballisinthestraight (b)thenalcondition: (a)thestartcondition: (t2)= 2 (0)= 2 _(0)=0: _(t2)=0: (47) whichcorrespondstothefollowingequation(noticethattheballisinfreeightafter leavingthehandattimet1). (c)h(t1)+t_h(t1) 12GTT2=B Thegoalconstraintinthiscaseisthattheballgoesintobasketattimet1+T (48) positionoftheendeectorofthearm(seefigure8)whichisafunctionovertime. whereg=(0;g;0)isthegravityvector,bisthepositionofthebasket,andhisthe alimitedrange.forexample,ahumancannotmovehis(her)armbackandup.to Wemaywanttoputsomelimitsonthejointanglesothatthearmonlymovesin (49)
CHAPTER2.PRELIMINARIES simulatethis,wecanlimittobeintherange[ ;=2].Thuswehavethefollowing inequality: (d) (t)=2;8t2[0;t2]: 24 suchastoperformthetasksspeciedbytheconstraintswithminimumenergyor someotherstyleconsideration.inthisexample,wecanusethegeneralizedforces (see(46))astheobjectivefunctiontominimize.noticethatthegeneralizedforce Aftertheconstraintsarespecied,theuserneedstosupplyanobjectivefunction (50) isafunctionovertime,soweneedtointegrateovertime.formallytheobjective functionisthefollowing: whereisthegeneralizedforce. constrainedoptimizationproblemwheretheunknownsareasetoffunctionsthrough Afteraseriousofspecicationsofobjectiveandconstraints,weendupwitha Z2((t);_(t);(t)); time(trajectories)ofeachdegreeoffreedom(dof).inthisexample,theoptimization (51) problemis: minimize(51) maticsanddynamicsformulasasderivedintheprevioussections.inthefollowing intermsoftheunknowns.ingeneral,thiscanbeperformedbyusingthethekine- Theunknownis(t)whichisascalarfunctionovertime. Inordertosolvetheoptimizationproblem,theexpressionshavetoberepresented s:t: (47) (50) (52) linkisdenoted0.theoriginofthelinkisdenotedq.let(qx;qy;0;1)denotethe thepurposeistodemonstratethegeneralframework. pressionsin(52).forsuchasimpleexample,thismaynotbethesimplestway,but wewillshowindetailhowtousetheformulasinprevioussectionstoderivetheex- Theworldcoordinatesystemisdenoted,andthelocalcoordinatesystemofthe
CHAPTER2.PRELIMINARIES homogeneouscoordinateofqwithrespectto.letldenotethelengthofthelink. Thetransformationmatrixof0is W0=<z()=0B@cos() sin()00 25 SincethelocalcoordinateofHisH0=0B@L01 0 sin()cos()00 0 10 01 1 CA,from(30), CA: (53) and_h=w0h0=0b@ Lsin()_ H=W0H0=0B@Lcos() 01 1CA Lcos()_ (54) Soconstraint(c)becomes 0 1CA qx+lcos() TLsin()_=bx (55) densityofthelinkisconstant,thenrlx=0x2dx=13l3=13l2mwheremisthe computethetorque,weneedtocomputetheinertialtensorj.assumingthemass wherebxandbyarethexandyworldcoordinatesofb.touseequation(46)to qy+lsin()+tlcos()_ 0:5gT2=by (56) massofthislink.therefore (57) J=0B@13L2m00 0 00 1 CA (58)
(thedetailsareomitted),onecanobtainthat CHAPTER2.PRELIMINARIES wheremeanswedon'tcareaboutthevalue.finallythecenterofgravityr0= (0;L=2;0)T.Nowwecanapplyequation(46),andaftersomealgebraicmanipulations 26 Insummary,wehavethefollowingoptimizationproblem: =13mL2+12mgLcos(): s:t:(0)= 2 minrt2 0(13mL2+mgL 2cos())2dt (59) qy+lsin((t1))+tlcos((t1))_(t1) 12gT2=by qx+lcos((t1)) TLsin((t1))_(t1)=bx (t2)= 2 _(0)=0 (t)=2;8t2[0;t2] _(t2)=0: (60) Problemslikethis,inwhichtheunknownsarefunctions(inthisexample,theunknown isthetrajectory(t)over[0;t2]),iscalledavariationalproblem[19].ingeneral,there Finiteelementmethodsconvertaninnitedimensionalproblemintoanitedimensionalproblembyreducingthefunctionspaceofpossibletrajectoriestoanite isnoclosedformsolution.numericallywecansolvethisproblembyusingnite elementmethodswhicharethetopicofthenextsection. 2.7TheFiniteElementMethod thefunctionspace.thenanydegreeoffreedomfunctioni(t)canberepresentedas alinearcombinationofthesebasisfunctions: dimensionalfunctionspace.forexample,wecanchoosesplinespaces,whichare havechosenanitedimensionalfunctionspace,wecanchooseabasisforthisspace. SupposeB1(t),B2(t),...,Br(t)arethebasisfunctionswhereristhedimensionof spacesofpiecewisepolynomials,asthenitedimensionalfunctionspaces.afterwe i(t)=ci1b1(t)+ci2b2(t)+:::+cirbr(t) (61)
CHAPTER2.PRELIMINARIES wherecijarecoecients.thederivativesaresimply _i(t)=ci1_b1(t)+ci2_b2(t)+:::+cir_br(t); (62) 27 andi(t)=ci1b1(t)+ci2b2(t)+:::+cirbr(t) optimizationproblem....,andcir.theproblemthusbecomesanitedimensionalnonlinearconstrained as(60),replacingtheunknowntrajectoryfunctionwithscalarunknownsci1,ci2, Wecansubstitutetheseequationsintothespacetimeconstraintformulationsuch (63) coecients)canbecomputedbyusingchainrules GivenafunctionF(i;_i;i),itsgradient(partialderivativeswithrespecttothe @cik=@f @i@i @ibk+@f @cik+@f @_i_bk+@f @_i@_i @cik+@f @ibk @i@i @cik Eachintegralcanbeapproximatedbysomequadratureformulas[48].Thesimplest Foranintegralexpression,wehavethesimilarformula: R@F @cikdt=r@f @ibkdt+r@f @_i_bkdt+r@f @ibkdt (64) istosimplysumtheintegrandvaluesatsamplepointsoverthewholeintegration interval.tosaveunnecessarycomputations,weactuallyonlyneedtosamplepoints wherebkisnonzero.thesubintervaloverwhichbkisnonzeroiscalledthesupport (65) 2.8CubicSplines Splinesarepiecewisepolynomialswhichareusedtoapproximatefunctionsinnumericalcomputations.Inthisthesis,wemainlyusetwotypesofcubicsplines:Hermite Bkiscalledcompact. ofbk,andbkissaidtocoverthesupport.ifthesupportofbkisaniteinterval, here.thereaderisreferredto[22,4]fordescriptionsofgeneralsplines. splinesanduniformb-splines.sowewillonlytalkaboutthesetwotypesofsplines
Givenaninterval[t0;t1],andfournumbersA0,P0,A1andP1,thereisauniquecubic CHAPTER2.PRELIMINARIES 2.8.1HermiteSplines polynomial 28 sothath(t0)=a0; h(t)=a+b(t t0)+c(t t0)2+d(t t0)3 h(t1)=a1; dh(t0) dt=p0; (66) cally,wecanthinkoftheproblemasinterpolatingtwopoints(t0;a0)and(t1;a1)with ThispolynomialiscalledacubicHermitepolynomial(orHermitespline).Geometri- dh(t1) dt=p1: (67) ittobeh(a0;a1;p0;p1;t0;t1;;t)toshowitsdependenceona0;a1;p0;p1;t0;t1. andthisinterpolationmethodiscalledhermiteinterpolation.sometimeswedenote theslopesp0andp1,respectively.thecorrespondingcurveiscalledahermitecurve, Bysolvingequationsfrom(67),onecanndthat Substituting(68)into(66),andcollectingterms,wehavetherepresentationinterms a=a0; oflinearcombinationofbasisfunctions: b=p0; c=(3a1 3A0 P1(t1 t0) 2P0(t1 t0)) d=2a0 2A1+P1(t1 t0)+p0(t1 t0) (t1 t0)3 (t1 t0)2 ; wherethebasisfunctionsare h(t)=a0b0(t)+a1b1(t)+p0b2(t)+p1b3(t) B2(t)=(t t0)+ 2(t1 t0)(t1 t0)3(t t0)3 B0(t)=1+ 3 B1(t)=3 (t1 t0)2(t t0)2+ 2 (t1 t0)2(t t0)2+2 (t1 t0)2(t t0)2+(t1 t0) (t1 t0)3(t t0)3 (t1 t0)3(t t0)3 (69) B3(t)= (t1 t0) (t1 t0)2(t t0)2+(t1 t0) (t1 t0)3(t t0)3 (70)
CHAPTER2.PRELIMINARIES 29 1.0 0.8 0.6 Figure9showsthefourbasisfunctionswitht0=0andt1=1. 0.4 A0;A1;:::;AnandP0;P1;:::;Pn,thereisauniquefunctionH(t)whichisapolynomial overeachsubinterval[ti;ti+1],sothath(ti)=aianddh(ti) Figure9:TheHermitesplinebasisfunctionsover[0;1] 0.2 0.0 H(t)iscalledaHermitecubicspline,orpiecewiseHermitecubiccurve,orHermite Supposewearegivenasequenceofpointst0<t1<:::<tn.Foranygiven H(t)=h(Ai;Ai+1;Pi;Pi+1;ti;ti+1;t);t2[ti;ti+1];0in 1: dt=pi.infact, (71) 0.0 0.2 0.4 0.6 0.8 1.0 x sincethebasisrepresentationisrarelyused,wewillnotgivethedetails.itisnot interpolation. hardtoverifythatthathermitesplineshavecontinuousrstorderderivatives,but notsecondorderderivatives. Wecanalsoobtainthebasisfunctionrepresentationbyusing(69).However, TherearerichtheoriesaboutgeneralB-splines[4],butweonlydescribecubicuniform 2.8.2UniformB-splines B-spineshere. 0;:::;n 1,wherenissomepositiveinteger.Inotherwords,eachsplineisa(cubic) FirstweconsiderB-splinesovertheinterval[0;n]withnsegments[i;i+1];i= y
CHAPTER2.PRELIMINARIES 30 1.0 0.8 0.6 functionsbi(t);i= 3; 2; 1;0;1;:::;n 1,where polynomialovereachsubinterval[i;i+1],i=0;:::;n 1.Therearen+3basis Figure10:TheuniformB-splinebasisfunctionsover[0;4] 0.4 0.2 B0(t)=8><>: t36 3(t 1)3+3(t 1)2+3(t 1)+1 0.0 (4 t)3 3(t 2)3 6(t 2)2+46 6 t<0 0t<1 2t<3 1t<2 0 1 2 3 4 6 3t<4 x andtheotherbasisfunctionsareallthetranslationsofb0(t):bi(t)=b(t i), i= 3; 2;:::;n 1.Figure10showsthe7basisfunctionsover[0;4]:B 3;:::;B3. 0 4t (72) EachB-splinecurveisalinearcombinationofthesebasisfunctions Bi 2(t),Bi 1(t),andBi(t).Thus wheretheci'sarecoecients.noticethatforanyt2[0;n],thereareonlyfourbasis functionswhicharenonzeroatt.ift2[i;i+1],thesefourbasisfunctionsarebi 3(t), b(t)=n 1 X b(t)=ci 3Bi 3(t)+ci 2Bi 2(t)+ci 1Bi 1(t)+ciBi(t): (74) y i= 3ciBi(t); (73)
CHAPTER2.PRELIMINARIES lineartransformations.theb-splinebasisfunctionsover[a;b]are B-splinesovertheinterval[a;b]canbeobtainedfromB-splinesover[0;n]using Bi(t)=Bi(t a b an);i= 3; 2;:::;n 1: (75) 31 terminologyanddescribetheconstructionoftwowavelets:haarwaveletsandchui-.2.9wavelets Inthissection,wegiveabriefintroductiontowavelets.Wewillintroducesome thesetwofunctionsisdenedas WangB-wavelets.Forageneralandmoretheoreticaltreatmentofwavelets,the readerisreferredtothemonographsbychui[12]anddaubechies[16].partofthe materialsgiveninthissectionisextractedfrom[40]. functionspaces.givenanytwofunctionsf(t)andg(t),the(l2)innerproductof Beforewegototheintroductiontowavelets,let'sreviewafewconceptsregarding (hf(t);f(t)i)12iscalledthe(l2)normoff(t),denotedbyjjfjj.ifhf(t);g(t)i=0,we sayfandgareorthogonaltoeachother.givenanytwofunctionspacesvandw, theirsumisafunctionspacewhichconsistsofallthefunctionsoftheformf(t)+g(t) hf(t);g(t)i=z+1 wheref2vandg2w.ifallfunctionsinvareorthogonaltoallfunctionsinw, 1f(t)g(t)dt (76) h(t)=f(t)+g(t).inthiscase,f(t)iscalledtheorthogonalprojectionofh(t)into calledadirectsum,andisdenotedbyv_+w. V.Itisanimportantfactthatf(t)isthebestapproximationofh(t)inthespaceV, thatis, thenvandwareorthogonaltoeachother,inwhichcase,thesumofvandwis IfU=V_+W,thenforanyh(t)2U,thereexistf(t)2Vandg(t)2Wsothat Theproofissimplythefollowing: jja hjj2=jja f gjj2=jja fjj2+jjgjj2jjgjj2=jjf hjj2: jjf hjjjja hjj;8a(t)2v: (77) (78)
CHAPTER2.PRELIMINARIES 32 ToillustratethebasicconceptoftheHaarwaveletconstruction,let'sconsiderthe 2.9.1HaarWavelets spacevlofallthosefunctionswhicharedenedover[0;1]andarelinearcombinations Figure11:TwoscalerelationshipofHaarbasis positiveinteger,and ofthe2lbasisfunctionsl;j(t)=(2lt j),j2[0;2l 1],whereLissomegiven whichareconstantsovereachinterval[2 Lj;2 L(j+1)),j2[0;2L 1].Nowlet's (t)=8<:10t<1 considervl 1whichisgeneratedbythe2L 1basisfunctionsL 1;j(t)=(2L 1t j) to1over[2 Lj;2 L(j+1))and0elsewhere.SoVLconsistsofallthosefunctions iscalledascalefunction.foreachj2[0;2l 1],L;jisaboxfunctionwhichisequal 0otherwise (79) VL;j,weneedthefollowingequality,calledthetwoscalerelationship, aswideasthoseinvl.clearly, wherej2[0;2l 1 1].EachbasisfunctionL 1;jisalsoaboxfunction,butistwice ToseehowtorepresentL 1;jasalinearcombinationofthosebasisfunctionsin (t)=(2t)+(2t 1): VL 1VL: (81) (80) thatis, SeeFigure11. Substituting2L 1t jfortin(81),weobtain L 1;j=L;2j+L;2j+1: (2L 1t j)=(2lt 2j)+(2Lt 2j 1); (83) (82) ϕ(t) ϕ(2t) ϕ(2t 1) = + 0 1 0 1 0 1
CHAPTER2.PRELIMINARIES 33 thatvl 1_+WL 1=VL: SinceVL 1VL,theremustexistasubspaceWL 1ofVLorthogonaltoVL 1so Figure12:TheHaarwaveletfunction (t) ThisiscalledadecompositionofVL.Infact,WL 1isgeneratedbythefollowingbasis functions: L 1;j(t)= (2L 1t j);j2[0;2l 1]; (84) where (t)=8><>: 10t<1=2 0otherwise 11=2t<1 (86) (85) fortintheaboveequality,weobtain asshowninfigure12 whichiscalledthetwoscalerelationshipforwaveletfunctions.substituting2l 1t j Inthefollowing,weshowwhy(84)istrue.Itiseasytoseethat (2L 1t j)= (2Lt 2j)+(2Lt 2j 1); (t)= (2t)+(2t 1); (88) (87) 1 1 ψ(t) 0.5 1 t
CHAPTER2.PRELIMINARIES thatis L 1;j= L;2j+L;2j+1: (89) 34 Theinverseof(83)and(89)is Thisshowsthat WL 1VL: L;2j=12L 1;j 12 L;2j+1=12L 1;j+12 L 1;j (90) ThisshowsthatVLVL 1_+WL 1;ItisatrivialvericationtoseewhyL 1;jis orthogonalto Noweachfunctionf(t)inVLhastworepresentations: L 1;iforalliandj.Therefore(84)holds. (91) andf(t)=2l 1 1 Xj=0cL;jL;j; Xj=0cL 1;jL 1;j+2L 1 1 Xj=0wL 1;j L 1;j: (92) Asdiscussedinthebeginningofthissection,thetermPjcL 1;jL 1;jisthebestapproximationoff(t)inthespaceVL 1,andiscalledthesmoothpartoff(t).Theother termpjwl 1;j L 1;jisthedierenceofthisapproximationfromtheoriginalfunction (93) f(t),calledthedetailpart.thecoecientscl 1;j'sarecalledsmoothcoecients,and thecoecientswl 1;j'sarecalleddetail(orwavelet)coecients. fcl;jg2l 1 Nowlet'sseehowtotransformbetweenthetwosetsofcoecients,namely, j=0andfcl 1;j;wL 1;jg2L 1 1 f(t)=p2l =P2L 1 1 j=0(cl;2j(12l 1;j 12 j=0(cl;2jl;2j+cl;2j+1l;2j+1) j=0cl;jl;j j=0((12cl;2j+12cl;2j+1)l 1;j+( 12cL;2j+12cL;2j+1) j=0.from(92),wehave L 1;j)+cL;2j+1(12L 1;j+12 L 1;j)) L 1;j)(94)
CHAPTER2.PRELIMINARIES wherethethirdequalityisfrom(91)andthelastoneisbycollectingterms.compare thiswith(93),wehave cl 1;j=12cL;2j+12cL;2j+1 35 Wecanimmediatelyseetheinverseofthisrelationship,namely, wl 1;j= 12cL;2j+12cL;2j+1 cl;2j+1=cl 1;j+wL 1;j cl;2j=cl 1;j wl 1;j (96) (95) andanyfunctionf(t)2vlcanberepresentedas way,wehaveanotherdecompositionofvl WecanrepeatthisdecompositionlogicandreplaceVL 1byVL 2_+WL 2.Inthis Ingeneral,foranyL0<L,wehaveadecompositionofVL: f(t)=2l 2 1 VL=VL 2_+WL 2_+WL 1; Xj=0cL 2;jL 2;j+2L 1 1 Xj=0wL 2;j L 2;j+2L 1 1 Xj=0wL 1;j L 1;j: (97) VL=VL L0_+L 1 i=l L0Wi; X (98) andf(t)canberepresentedas f(t)=2l L0 1 Xj=0cL L0;jL L0;j+L 1 l=l L02l 1 XXj=0wl;j l;j: (100) (99) WhenL0=L,wehave andf(t)=c0;00;0+l 1 VL=V0_+L 1 Xi=0Wi; ThecasewhenL=3isshowninFigure13. Xl=02l 1 Xj=0wl;j l;j: (101) (102)
CHAPTER2.PRELIMINARIES 36 ϕ waveletbasis(orsimplyhaarbasis).inthisnewbasis,each Thisnewbasisf0;0g[f Figure13:HaarbasisfunctionswhenL=3 l;jj0j2l 1;0lL 1giscalledtheHaar 0,0 average,andateachlevelgoingdown,thewaveletbasisfunctionsrepresentthener (orawaveletfunction).andallthefunctions functionshierarchically.thewidestboxfunction0;0(t)=(t)representstheoverall translationofthesinglefunction Thisnewbasisalsocontains1+PL 1 (t).thisspecialfunction l=02l=2lbasisfunctions.butitrepresents l;jarecalledwaveletfunctions. (t)iscalledawavelet l;jisascalingand andnerdetails.ifatsomepoint,thefunctionhasnomoredetail(i.e.,thefunction isconstantoverthesupportofthewavelet),thecorrespondingwaveletcoecientwill bezeroaswillallnerwaveletsbelow. Forexample,considerthefunction(seeFigure14) f(t)=8><>:2t2[0;14) 2t2[14;24) coecients2:25;0:25;0,and 1:5,respectively(wewilldescribethealgorithmsto respectively.alternatively,onecanusethewaveletbasis0;0; Wecanuse2;0,2;1,2;2,and2;3torepresentf(t)byusingcoecients2;2;4;1, 4t2[24;34) 1t2[34;1) 0;0; 1;0,and 1;1with (103) iscalledapyramidtransformation.giventhecoecientsfcl;jg2l 1 thecoecientof functionissmooth(constant)overinterval[0;0:5]which computethesecoecientslater).noticethatthecoecientof ThetransformationtoandfromthecoecientsoftheHaarwaveletbasisfunctions 0;0is2.25,theaveragevalueoverthethewholedomain. 1;0covers.Alsonotethat 1;0is0,becausethe j=0oftheoriginal ψ 0,0 ψ 1,0 ψ 1,1 ψ 2,0 ψ 2,1 ψ 2,2 ψ 2,3
CHAPTER2.PRELIMINARIES 37 basisfunctions,thecoecientsofthehaarbasisfunctionscanbecomputedbyusing theformula(95)(seehaarcoefxformup)ltimes,asshowninhaarcoefpyrmup. Conversely,giventhecoecientsoftheHaarbasis,c0;0andwl;j,j2[0;2l 1] l2[0;l 1],haarcoefpyrmdowncomputescL;j;j2[0;2L 1],byapplying(96) Figure14:f(t)=22;0+22;1+42;2+2;3=2:250;0+0:25 0;0 1:51;1 (seehaarcoefxformdown)ltimes. haarcoefpyrmup(cin[],cout[],wout[][],l) cout[0]=ctemp[0][0]; for(l=l;l1;l ) ctemp[l][]=cin[]; haarcoefxformup(ctemp[l][],ctemp[l 1][], wout[l 1][],l); 4 3 2 1 0 f(t) 1/4 2/4 3/4 1 t
CHAPTER2.PRELIMINARIES haarcoefpyrmdown(cin[],win[][],cout[],l) ctemp[0][0]=cin[0]; 38 for(l=1;ll;l++) cout[]=ctemp[l][]; haarcoefxformdown(ctemp[l 1][],win[l 1][], ctemp[l][],l); haarcoefxformup(cin[],cout[],wout[],l) gfor(j=0;j<2l 1;j++)f wout[j]= 12cin[2j]+12cin[2j+1]; cout[j]=12cin[2j]+12cin[2j+1]; haarcoefxformdown(cin[],win[],cout[],l) for(j=0;j<2l 1;j++)f cout[2j]=cin[j] win[j]; 2L+1 1,andhencetheyruninlineartime(intermsofthenumberofbasisfunctions, gbothhaarcoefpyrmupandhaarcoefpyrmdowntaketime2l+2l 1+:::+1= cout[2j+1]=cin[j]+win[j]; whichis2linthiscase).
thenconsiderwaveletsontheintervalinthenextsection. Inthissection,weconsiderthewaveletsonthewholereallineRrst,andwewill CHAPTER2.PRELIMINARIES 2.9.2B-splineWavelets 39 generatedbyboxfunctions(zeroorderb-splines),b-splinewaveletbasisisanalternatebasisforthefunctionspacegeneratedbycubicb-splinefunctions(inthis section,wewillonlyconsideruniformcubicb-splines).thescalefunctionisthe cubicb-splinebasisfunction: UnliketheHaarwaveletbasiswhichisanalternatebasisforthefunctionspace andletvlbethefunctionspacegeneratedbyfl;jjj2zgwherezissetofall whereb0isdenedin(72).similarlydene L;j=(2Lt j); (t)=b0(t) (105) (104) wellknownb-splineknotinsertionalgorithm[5,12],whichis ThetwoscalerelationshipfortheB-splinescalefunctioncanbeobtainedfromthe integers.againwehave (t)=4xi=0hi(2t i): VL 1VL: (106) wherethenonzeroelementsofhisdenedinthefollowing: h[0::4]=18f1;4;6;4;1g: (107) obtainl 1;j=2j+4 Substituting2L 1t jfort,andreplacingibyk 2jontherighthandside,we k=2jhk 2jL;k X (109) (108) SeeFigure15. functionsothatitsscalingandtranslationsformabasisofwl 1.Actuallythereare SimilarlythereexistsaWL 1sothatVL=VL 1_+WL 1,andthereexistsawavelet
CHAPTER2.PRELIMINARIES 40 Figure15:FiveB-splinesL;jmaybecombinedusingtheweightshtoconstructthe morethanonesuchwaveletfunction.theonewegivebelowiscalledchui-wang Figure16:ElevenB-splinesL;jmaybecombinedusingtheweightsgtoconstruct thewaveletfunction L 1;0 doublewidthb-splinel 1;0g B-wavelet[12].ThetwoscalerelationshipforChui-WangB-waveletfunctionis wherethesequencegisgiveninthefollowing(see[40,50]): g[0::10]=18!f 1;124; 1677;7904; 18482;24264; 18482;7904; (t)=10xi=0gi(2t i): 1677;124; 1g: (111) (110) obtain Substituting2L 1t jfort,andreplacingibyk 2jontherighthandside,we ofl 1;jand SeeFigure16. Similarto(91)inHaarwaveletcase,onecanalsorepresentL;jasacombination L 1;j=2j+10 L 1;jasthefollowing: k=2jgk 2jL;k X (112) L;j=Xk~hj 2kL 1;k+Xk~gj 2k L 1;k (113) φ L 1 φ L ψ L 1 φ L 0 g = h = 1/8 * 0 0 1 4 6 4 1 φ L 1,0 ψ L 1,0 g 1 g 2 g 3 g 4 g 5 g 6 g 7 g 8 g 9 g 10
functionsanddualwavelets. CHAPTER2.PRELIMINARIES Toseehowtocompute~hand~g,weneedtointroducetheconceptofdualscaling Thefunctions~L;jarecalleddualtoL;k(ordualscalingfunctions)if 41 wherej;k=8<:1j=k h~l;j;l;ki=j;k;j;k2z 0j6=k (114) iscalledthekroneckerdelta. Thefunction~L;jarecalleddualto h~l;j; L;ki=j;k;j;k2Z L;k(ordualwavelets)if and~gj 2k=hL;j;~L 1;ki; Takinginnerproductsin(113)with~L 1;kand~L 1;krespectively,weobtain ~hj 2k=hL;j;~L 1;ki; (116) (115) [12].Thesequences~hand~ghaveinnitelengthbutdecayquicklyfromtheircenters. coecientscanbederivedinthesamewayasinthehaarwavelets.similarto(92) ThepyramidtransformationbetweentheB-splinecoecientsandthewavelet Thederivationofthedualscalingfunctionsandthedualwaveletsaredescribedin (117) and(93),afunctioninvlhastworepresentations: andf(t)=xjcl 1;jL 1;j+XjwL 1;j f(t)=xjcl;jl;j; L 1;j: (118) Comparing(118)and(119),andsubstituting(109)and(112)into(119),weobtain XjcL;jL;j=XjcL 1;j2j+4 k=2jhk 2jL;k+XjwL 1;j2j+10 X k=2jgk 2jL;k X (120) (119)
CHAPTER2.PRELIMINARIES Exchangingthesummationorders,weobtain XjcL;jL;j=XkX k=2 2jk=2cL 1;jhk 2jL;k+XkX k=2 5jk=2wL 1;jgk 2jL;k(121) 42 obtaincl 1;j=XjcL;j~hj 2k; Therefore Similarlyifwesubstitute(113)into(119),andcomparing(118)and(119),we cl;k=x k=2 2jk=2cL 1;jhk 2j+X k=2 5jk=2wL 1;jgk 2j (123) (122) andwl 1;j=XjcL;j~gj 2k: whicharedenedoverthewholerealliner.butinananimationcontext,only 2.9.3B-splineWaveletsonaBoundedInterval TheB-splinewaveletsdescribedinthelastsectionareusedtorepresentfunctions (124) a)=(b a))sothatg(t)isdenedover[0;1]. functions. afunctionf(t)denedoverageneralinterval[a;b],onecandeneg(t)=f((t eciencypointofview,itisimportanttoonlydealwithanitenumberofbasis functionsoversomexedniteintervaloftimeneedtobeexpressed,and,fromthe zero'sin[0;1]canbeignored.letvlj[0;1]denotethespaceofthefunctionsofvl truncatedon[0;1].itiseasytocheckthatonlyforj2[ 3;2L 1],L;j(t)'ssupport Sinceweareonlyinterestedintheinterval[0;1],thosebasisfunctionswhichare Withoutlossofgenerality,weassumeallthefunctionsaredenedover[0;1].For intersects[0;1].andthesefunctionsarelinearlyindependent.sothebasisfunctions ofvlj[0;1]arefl;jjj= 3;:::;2L 1g,andhencethedimensionofVLj[0;1]is2L+3. entirelyinside[0;1].theyarecalledinnerb-splinebasisfunctions.andthereare 3functionstruncatedoneachofthetwoboundaries,whicharecalledleftandright boundaryb-splinebasisfunctions.fortheboundarybasisfunctions,analternative Amongthisbasis,thereare2L 3functions,L;j;j2[0;2L 4],whosesupportsare
CHAPTER2.PRELIMINARIES wayistousespecialboundarybasisfunctionsthatarisefromplacingquadrupleknots attheboundaries[5].thiscompletesetofbasisfunctionswillbedenotedl;jwith jin[ 3;2L 1],whereitisunderstoodthattherstandlastthreebasisfunctions 43 arethespecialboundaryb-splinebasisfunctions. basisfunctionsas lastthreebasisfunctionsarethespecialboundarywaveletbasisfunctionswhichwill boundarywaveletbasisfunctions.theinnerbasisfunctionsare 7,asdenedin(112).Theseinnerbasisfunctionsliecompletelyinside[0;1].There arethreespecialboundarywaveletbasisfunctionsoneachside.wedenotethese ThewaveletbasisforWL 1j[0;1]alsocontainsinnerwaveletbasisfunctionsand bedescribedbelow.afulldescriptionofthisconstructionisgivenin[11,50]. L 1;jj2[ 3;2L 1 4],withtheunderstandingthattherstand L 1;j,j=0;:::;2L 1 wherehj;karegivenbelow: ThetwoscalerelationshipsfortheboundaryB-splinebasisfunctionsare L 1;2L 1 (4+j)=P2j+4 L 1;j k=jhj;kl;2l 4 k;j2[ 3; 1] k=jhj;kl;k;j2[ 3; 1] h 2;[ 2;0]=116f8;12;3g; h 3;[ 3; 2]=116f16;8g; (125) Thetwoscalerelationshipsfortheboundarywaveletbasisfunctionsare h 1;[ 1;2]=116f4;11;8;2g: L 1;j L 1;2L 1 (7+j)=P10+2j k= 3gj;kL;k;j2[ 3; 1] k= 3gj;kL;2L 4 k;j2[ 3; 1] (126) (127)
CHAPTER2.PRELIMINARIES wheregj;karegivenbelow(see[40,50]): 44 18! 0 1655323200 1136914560 1321223960 27877 2387315040 g 3 278772141121840 878161880 g 2 195139123066720 2226000 188417600 g 11CA 633094403 46819570 229000092 124 27877 498772701 27877 3606490941 4726413628 19513910796596516 7904 195139 25245248833 27877 2293862247 24264 1365937 B@ 1 0 1677 124 0 18482 1677 7904 124 (128) : : 0 HerethestartingsmoothfunctionspaceisV3insteadofV0asinthecaseofHaar Similartotheequation(101),onecanobtainthedecompositionofVLas VL=V3_+L 1 Xl=3Wl : basisfunctionsdon'tintersecttherightboundaryfunctions.thecorrespondingbasis waveletbasis.thereasonisbecauseweneedtomakesuretheleftboundarywavelet consistsofthefunctionsf3;kjk2[ 3;7]g[[L 1 l=3f l;kjk2[ 3;2l 4]g. (129) theprocedurecoefxfromdownasdenedbelowcomputesthecoecientsfcl;jjj2 [ 3;2L 1]gbyusing(109),(112),(125)and(127): GiventhecoecientsfcL 1;jjj2[ 3;2L 1 1]gandfwL 1;jjj2[ 3;2L 1 4]g,
CHAPTER2.PRELIMINARIES coefxformdown(cin[],win[],cout[],l) cout=0;/*zerovector*/ 45 for(k=0;k2l 1 4;k++) for(kin[ 3, 2, 1,2L 1 3,2L 1 2,2L 1 1]) for(k=0;k2l 1 7;k++) for(j=2k;j(2k+10);j++) for(j=2k;j(2k+4);j++) cout[j]+=g[j 2k]win[k]; cout[j]+=h[j 2k]cin[k]; for(kin[ 3, 2, 1,2L 1 4,2L 1 5,2L 1 6]) cout+=hkcin[k];/*vectoraddition*/ g2l 1 j;k=gj 7;2L 4 k,2l 2jk2L 1,j=1;2;3. where h2l 1 j;k=hj 4;2L 4 k,2l 2jk2L j,j=1;2;3, cout+=gkwin[k]; andsotheinverseprocedurecoefxformup(cin[],cout[],wout[],l)canbe obtainedbysolvingthisbandedlinearsystem. Theaboveprocedurecanbeexpressedasmultiplicationbyabandedmatrix, indexingusinglinearstorage). transformsan2l+3-vectortoan2l+3-vector,itcanbeimplementedwithproper tocoefxformupeachtimewithaninputvectorof12thelength.(notesincethis cientscanbedonebyusingtheprocedurecoefpyrmup,thatmakesl 3calls ThetransformationfromtheB-spinecoecientstothefullwaveletbasiscoef-
CHAPTER2.PRELIMINARIES coefpyrmup(cin[],cout[],wout[][],l) ctemp[l][]=cin[]; 46 for(i=l;i4;i ) Theinversetransformationis cout[]=ctemp[3][]; coefxformup(ctemp[i][],ctemp[i 1][], wout[i 1][],i); coefpyrmdown(cin[],win[][],cout[],l) for(i=4;il;i++) ctemp[3][]=cin[]; coefxformdown(ctemp[i 1][],win[i 1][], series(2l+2l2+2l4+:::+1)=o(2l),sotheyruninlineartime. Therunningtimeofthesepyramidtransformationsisgovernedbythegeometric cout[]=ctemp[l][]; ctemp[i][],i); Anunconstrainedminimizationproblemhastheform 2.10.1UnconstrainedOptimization 2.10NonlinearOptimization wheref(c)=f(c1;c2;:::;cn)isamultivariatefunction,andrnisthen-dimensional Euclideanspace.Apointxiscalledalocalminimumpointiff(x)hasthesmallest minimizef(c);c2rn (130)
thesmallestvalueinthewholespacern. CHAPTER2.PRELIMINARIES valueinsomeneighborhoodofx.xiscalledaglobalminimumpointiff(x)has Wewillonlydiscussthemethodofndinglocalminimumpoints.Theproblem 47 ofndingtheglobalminimumpointisconsiderablymoredicultandnopractical methodshavebeenfoundsofar.theinterestedreaderisreferredto[18]. whereg(x)isthegradientoffatx[21].suchapoint,atwhichthegradientiszero, iscalledastablepoint.alocalminimumpointmustbeastablepoint,butthestable pointmaynotbealocalminimumpoint.however,almostalltheknownnonlinear optimizationmethodscanonlyguaranteetondastablepoint. Thenecessaryconditionsforxtobealocalminimumpointisthatg(x)=0, pointhasbeenfound).otherwise,letsk= gk. Thesimplestmethodisthegradientdecentmethod: Initialization:letc0betheinitialguess.andk=0. Step1. Step1:computethegradientgkoff(c)atck.Ifgk=0,terminate(thestable Step4:Stopifterminationconditionholds.Otherwise,letk:=k+1andgoto Step3:setck+1=ck+ksk. Step2:nd(k)tominimizeF(ck+sk). NoticethatdF(ck+sk) Thisensuresthatthefunctionvaluestrictlydecreasesateachstep.Whengk=0, isclosetozero.suchadirectionskiscalledadecentdirection.fromstep2and step3,f(ck+1)<f(ck): dj=0=gtksk= gtkgk<0:sof(ck+sk)isdecreasingwhen thenwehavereachedastablepoint,sowearedone.inpractice,weusuallywantto terminatewhenthesolutionisclosetoaminimumpoint.thechoiceoftermination conditionsdependontheapplications.somepossibilitiesare(1)jf(ck+1) F(ck)j<, (131) othermethodswhichrequiresecondorderderivatives,thismethodisalotcheaper. possibilitiesanddiscussions. chosenc0[21].suchpropertyiscalledglobalconvergence.anotheradvantageofthis methodisthatitonlyrequirescomputingtherstorderderivatives.comparedto or(2)jjgkjj<,or(3)jjck+1 ckjj<.thereaderisreferredto[21]forother Itcanbeprovedthat,underminorcondition,thismethodconvergesforany
CHAPTER2.PRELIMINARIES solutionsgetclosetothenalsolution,thesolutionmaytendtobouncebackand force.this\zigzag"phenomenoncanbecomeseriousandresultinpoorconvergence. Therateofconvergence,however,isonlylinear.Especiallywhentheiterative 48 ton'smethodisessentiallyarootndingmethodappliedtothegradientfunction. Theschemeisthesameasthegradientdecentmethodexceptskisdierent.Here sk= G 1 gence,butitmaynotconvergeforsomeinitialguesses.thereasonisthefollowing. Afastermethod,whichusessecondorderderivatives,isNewton'smethod.New- searchdirectionsk= G 1 Toensureconvergence,theobjectivevaluehastodecreaseateachiteration,i.e.,the positivedenite.therefore,inordertoensuretheconvergence,theinitialguessc0 hastobechosensuchthatthehessianmatrixatc0andallthesubsequentiterative kgkwheregkisthehessianmatrix.thismethodhasquadraticconver- pointsareallpositivedenite.forsimplicity,let'sassumethatthehessianmatrixat theoptimalsolutionispositivedenite.bycontinuity(assumingthattheobjective functionhassecondcontinuousderivatives),thereexistsaneighborhoodoftheoptimalsolution,suchthatthehessianmatrixatanypointinthisregionisalsopositive denite.ifwepickupc0fromthisregion,thenitcanbeshownthatallthesubse- theoptimalsolution,wesayitconvergeslocally. majordisadvantageisthatitrequirescomputingsecondorderderivativeswhichmay beexpensiveinpractice. EventhoughNewton'smethodcanbemodiedtoensureglobalconvergence,its kgkhastobeadecentdirection.thisrequiresgktobe [21].SinceNewton'smethodconvergencesonlywhenc0isinsomeneighborhoodof quentiterativepointsarealsointhisregion.thereforetheconvergenceisguaranteed. Foramoregeneraldiscussionontheconvergencecriteria,thereaderisreferredto whichhasbeenusedsuccessfullyinpracticeisthebroyden-fletcher-goldfarb-shanno (BFGS)method.IntheBFGSmethod,H0ischosenbytheuserwhichshouldbe matrixhkwhichiscorrectedorupdatedfromiterationtoiteration.onesuchmethod, Newton'smethodbutonlyrequirerstorderderivatives.Thistypeofmethodislike Newton'smethod,exceptthatG 1 Quasi-Newtonmethodsareaclassofmethodswithconvergenceratecloseto kisapproximatedbyasymmetricpositivedenite
CHAPTER2.PRELIMINARIES apositivedenitematrix(e.g.theidentity)toensurethats0= H0g0isadecent direction.ateachiteration,hkisupdatedbyusingtheformula Hk+1=Hk+ 1+THk T!T T THk+HkT 49 =ck+1 ck(thechangeinthecoecients). where=rfk+1 rfk(thechangeinthegradientofthecostfunction)and T! Hk'sarealsopositivedenite,andasaresult,sk'sarealldecentdirections.Therefore ItcanbeshownthataslongasH0ispositivedenite,thenallthesubsequent (132) whenh0ischosentobepositivedenitesuchastheidentity,bfgsmethodconverges foranychosenc0. Fletcher'sbook[21].Inourapplication,wedon'twanttocomputethegradientsduringthelinesearchsincegradientcomputationisexpensive.Thereforewewillonly discussmethodswhichdonotneedgradientcomputation.weperformanapproxi- iscalledalinesearch.thereareavarietyoflinesearchmethodsasdiscussedin Nomatterwhetherweusegradientdecentmethodorquasi-Newtonmethod,atstep 2.10.2LineSearch matelinesearch,thatis,weseekansothatf(ck+sk)sucientlydecreases(from 2ofeachiteration,weneedtondk>0whichminimizesF(ck+sk).Thisstep F(ck)).Wewilldescribetwosuchmethods:bisectionandquadraticinterpolation. userhastochooseaninitialguess0>0.tomakesurethat0isnottoosmall,we cantesttoseeifboth andf(0)<f(0=2): Forconvenience,denotef()=F(ck+sk).Foranylinesearchmethod,the Ifoneofthemisnottrue,thenweknowthatthereisaminimumpointintheinterval f(0)<f(0) (133) [0;0].Otherwise,wecandouble0toseeifthenew0(afterdoubled)satises (133)and(134).Repeatthisprocessuntilwenda0whichdoesn'tsatisfybothof (134)
CHAPTER2.PRELIMINARIES foata,b; oatbisectlinesearch(oat0) 50 fif(f(a)<f(b)) a=0; b=0; while(terminationconditionisnottrue) ggreturn(f(a)<f(b)?a:b); elsea=(a+b)/2; b=(a+b)/2; them.noticethattheoreticallyforsomefunctionsitmaytakeforevertondsuch 0,butinourexperiments,itcanalwaysbefoundeasily. bystartingwith[a;b],wherea=0andb=0,andcomparef(a)andf(b).if Thesimplestlinesearchmethodisthebisectionmethod.Bisectionmethodworks Figure17:Linesearch:bisectionmethod f:=df(0) (Figure17). be[(a+b)=2;b],andrepeatuntilsomeprespeciedterminationconditionissatised f(a)<f(b)thenletthenewintervalbe[a;(a+b)=2],otherwiseletthenewinterval f0+_ sothesearchstops.otherwise,wecomputetheminimumpointofthequadratic functioninterpolatedfromf0,fkand ThepseudocodeforthequadraticinterpolationmethodisgiveninFigure18. f0+f1+f1 f0 _ Thismethodseeksanksothatf(k)f0+0:5k_ f<f0+0:5_ d.noticethatsuchkmustexistsincewhenapproaches0,f() 212.Theminimumpointis _ f1f.iff(k)f0+0:5k_ f.theinterpolatedquadraticfunctionis f,thenf(k)hasdecreasedsuciently, 2f1 f0 _ ffwheref0:=f(0),and thealgorithm. Nowweshowthat0<k+1<ksothatwecanrepeatthisprocess. 21whichisusedask+1in f1
CHAPTER2.PRELIMINARIES 51 oatquadraticinterpolationlinesearch foat_ fi(i1)isanarraytodenotef(i). 1:=0; while(1) oatf0:=f(0); intk:=1; i(i1)isanarraystoringthevaluesintheiterations f:=df(0) d; ffk:=f(k) if(fkf0+k elsereturnk; fk+1:= _ 2_ f) gfigure18:linesearch:quadraticinterpolation ggk++; 2fk f0 _ (k)2. ffk
CHAPTER2.PRELIMINARIES Infact,sincef(k)>f0+0:5k_ k+1>0; f,fromthedenitionofkwehave (135) 52 andbyarrangingterms,oneobtains Adding 2 _ f<2(fk f0) ftobothsides,oneobtains =2kfk f0 kf k: k 2_ (k)2: (136) Dividingbothsidesby2fk f0 k k+1<k: (k)2,wehave (137) 2.10.3ConstrainedOptimization Aconstrainedminimizationproblemhastheform minimizef(c) (138) wheref(c)istheobjectivefunctiontominimize,theci'sarecalledequalityconstraints,andthedi'sarecalledinequalityconstraints. subjecttoci(c)=0;i=1;2;:::;m1 Aconstrainedoptimizationproblemcanbetransformedintoanunconstrained Di(c)0;i=1;2;:::;m2 (139) oneusingpenaltyfunctions.suchas problem139(fortheconstrainedoptimizationproblem,themeaningofstablepoint wherew1iandw2iarepositivenumbers,calledweights.itcanbeshownthat,as w1iandw2itendto1,thestablepointsofapproachthestablepointsofthe =F+m1 Xi=1w1iC2i+m2 Xi=1w2i(min(Di;0))2; hastobemodied.thisleadstothedenitionofkuhn-tuckerconditions[21]which isnotdiscussedinthisthesis).
CHAPTER2.PRELIMINARIES asdiscussedpreviously. Anothermoredirectmethodiscalledsequentialquadraticprogramming.Thisconsistsofasequenceofquadraticsubproblems(whicharesecondorderapproximations oftheoriginalproblem)makingaseriesofnewtonstepstowardsasolution.theattractionofthemethodisitsquadraticconvergence.buttherearetwodisadvantages. Afterthetransformation,wecanapplytheunconstrainedoptimizationmethod 53 methodrequirescomputingexplicithessian,thatis,secondorderderivatives.in theconvergencerate[21]).thesecondandmoreseriousdisadvantageisthatthis arenotclosetotheoptimalsolution,thismethodmaydiverge.however,thereare somewaystomodifythismethodtoensureglobalconvergence(withthesacriceof initialguessesaresucientlyclosetheoptimumsolution.whentheinitialguesses Firsttheconvergenceislocal,meaningthatthismethodconvergesonlywhenthe practice,thisisoftenexpensive.inourapplicationsasdescribedinthelaterchapters,computinghessiansisconsiderablymoreexpensivethancomputinggradients. However,thismethodhasbeenusedtosolvespacetimeconstraintproblems[56,13]. Whenthegurebecomesmorecomplex,theHessiancomputationalonecanbecome asthequasi-newtonmethods. computationallyforbidding.thus,weusemethodswhichonlyneedgradients,such thelackofgradients,thesemethodsdonothaveadecentnaturemeaningthatthe objectivevaluecangoupanddownduringthesolutionprocess.thustheconvergence nextsolutionisfoundwithsomerandomness(thesearchdirectionmayberandomly chosenorthenewsolutionisgeneratedthroughsomerandomprocess).becauseof search[54],geneticsearch[43],etc.ateachiterationofthesesearchmethods,the Thereareothersearchmethodswhichdonotrequiregradientssuchasstochastic methodsusinggradientinformation. 2.11InteractiveSpacetimeConstraintSystem Theinteractivespacetimeconstraintsystem,introducedbyCohen[13]in1992,has cannotbeguaranteed,andthesemethodsusuallyrequiremoreiterationsthanthe thestructureasshowninfigure19.inthissystem,theusercaninteractwiththe
CHAPTER2.PRELIMINARIES 54 Interactive Spacetime Constraints System Graphical User Interface Text Based Interface USER input to Constraint Numerical and Objective DiffEQs Optimization Equations Symbolic Solution of Motion Differentiation and Creature Optimizing Description Compiler Animation Display Figure19:TheInteractiveSpacetimeConstraintsSystem
c CHAPTER2.PRELIMINARIES 55 cos(θ) * cos 2 (α) + θ * cos 2 (θ) * cos 2 (α) + + * * * * A * * * * c c c iterativenumericaloptimizationandcanguidetheoptimizationprocesstoconverge subexpressionextraction.the\c"nodesrepresentthecosineoperator. B * * * toanacceptablesolution. Figure20:Thenumberofnodestobeevaluatedisgreatlydecreasedbycommon c c c c c θ α θ α expressions,whichformulateanoptimizationproblem,areparsedandtheevaluation treesgenerated.asymbolicdierentiationisappliedtotheseevaluationtreesand le),andphysicalequationsofmotioncanbegeneratedautomatically.thesymbolic Theuserspeciedconstraintscanbetypedinbytheuser(orreadfromaninput (a) (b) generatesnewevaluationtrees(calleddierentiationtrees)forgradient(andhessian) computation. theoptimizationparameterssuchasweightsinthepenaltyfunction,anddeleteor insertconstraints. usingakeyframingsystemandstarttheoptimizationprocess.ateachiteration,the usercanlookattheresultingmotion,andcanmodifythecurrentsolution,change Afterthepreprocessingstageisdone,theusercanprovideaninitialguessby
CHAPTER2.PRELIMINARIES 2.12Compilation,CommonSubexpressionElimination,andSymbolicDierentiation 56 Thecompilerisresponsibleforparsingtheexpressionsoftheconstraintsandobjective andgeneratingevaluationtreesforthenumericaloptimizationphase.itbeginswitha bottomupparserthatreadstheexpressions(objectiveandconstraints)andproduces anevaluationtreeforeachexpression(figure20(a)).formallyspeaking,anevaluationtreeisadirectedacyclicgraphinwhicheachleafrepresentseitheraconstant oravariable(dofvariablesandtherederivatives),andeachinnernoderepresentsa functionwhichcanbebinaryoperators+,-,*,or/,ortheunaryminus,sin, andrecursivelyevaluatingnodesupwarduntilthevalueoftheexpressioniscontained atthetopmostnode. nodet,l(t)andr(t)representthetwochildrenoft. cos,tan,cot,exp,log,and^a(power)whereaisanyrealnumber.foreach sionsareusuallyverylongresultinglargeevaluationtrees.forexample,evenaplanar three-linkarmcanresultinevaluationtreescontainingover145,000nodesthatmust TheevaluationiscarriedoutbyinsertingtheDOFvaluesintheleavesofthetree beevaluatedmultipletimesduringtheoptimizationprocess.toreducethesizeofthe evaluationtrees,thecompileroptimizationtechniqueofcommonsubexpressionelimination(cse)canbeused.morespecically,commonsubexpressionsareextracted Onebottleneckinthespacetimeconstraintsystemisthatthesymbolicexpres- byrecursivelymovingfromtheleavestothetopnode,makingalistofuniquenodes andcheckingeachnewnodeagainstthelist.inthecaseofleafnodesthatarealwaysvariableid's,thisissimple,forinternalfunctionnodestheirchildrenmustbe &&right==right) (left==right&&right==left))mustbechecked.ifthe nodesaredeterminedtobeequivalent,onenodeisusedforboth(figure20(b)). foreachinputnode,thusthegrowthduetodierentiationiso(n)withaconstant x,@t=@xisrecursivelydenedasshowninfigure21.simplybyenumeratingeach case,itcanbeseenthatanysingledierentiationgeneratesatmost5outputnodes checked,andinthecaseofcommutativeoperationsbothpossibilities((left==left GivenanevaluationtreeTandavariablex,thederivativeofTwithrespectto
CHAPTER2.PRELIMINARIES 57 + T T/ x L R R/ x L/ x * + L R * * R/ x L/ x / / Figure21:DierentiationRules(theunaryoperatorsarenotallenumeratedasmany ^2 aresimilar). L R L/ x R/ x sin * L cos L/ x
CHAPTER2.PRELIMINARIES factorof5.infact,sinceintheanimationapplicationthedivideisrare,theaverage growthismuchlessthanafactorof5. Asanexampleofthepowerofthecommonsubexpressionelimination,theevaluationtreesforaplanarthree-linkarmwithoutCSEcontained145,584nodes,compared to2,932nodesaftercse! 2.13Summary Wehaveintroducedthebasicideaoftheinteractivespacetimeconstraintssystem andthenecessarybackgroundforthenumericalandsymboliccomputations.while theinteractivespacetimeconstraintssystemsdoprovidephysicalrealismandcertain usercontrol,theyhavebeencomputationallyexpensive.inthesymbolicphase,even withcommonsubexpressionelimination,thesizesoftheevaluationtreesstillgrow exponentiallyintermsofthenumberofdegreesoffreedomsaswewillshowinthenext chapter.thenumericaloptimizationphaseisanotherbottleneckbecausethenumber ofunknownsintheresultingnonlinearoptimizationproblemisusuallylargeandeach iterationusuallyrequiresnumericalintegrations.wewillpresentbothsymbolicand 58 numericaltechniquestoaddresstheseissuesinthenextthreechapters.
Chapter3 EcientSymbolicInterface 3.1Introduction AsdescribedinChapter2,symbolicmethodshavebeenusedtorepresentconstraints Inthischapter,wedescribeanewsymbolicinterfaceforoptimizationbasedanimation andobjectivesinmanyoptimizationbasedanimationsystems[56,13].themajor system.thematerialsarefromthepaper[38]. automaticallybysymbolicdierentiation.forexample,withoutsymbolicmethods, allpossibletypesofconstraintsmustbehardcodedasinzhaoandbadler's[57] advantageofsymbolicmethodsisthattheyaregeneralenoughtorepresentvarious kindsofconstraintsandobjectivesandthegradientsandhessianscanbeobtained inversekinematicssystem.inaddition,gradientshavetobederivedmanuallywhich isverytediousevenwhentheexpressionsaresmall,andalmostimpossiblewhenthe expressionsbecomecomplex.anotheradvantageisthattheusercanmodifythe expressionssuchastheconstraintandobjectionfunctionsatruntime. techniqueshavebeenusedtoreducethesizesoftheevaluationtreesasdescribedin oftheresultingsymbolicexpressionsareexponentialinthedepthofthetreeofdegrees offreedom(dofs).thisproblemhasbeennoticedandsubexpressionelimination Section2.12([33]alsogivessimilartechniques).However,thisdoesnotfullysolve theproblemsincethesizeoftheevaluationtreesaftersubexpressioneliminationare However,onemajordisadvantageofprevioussymbolicsystemsisthatthelength 59
CHAPTER3.EFFICIENTSYMBOLICINTERFACE 60 L θ linki 1,isequalto haveaplanari-linkchainasshowninfigure22.usingtheterminologyinchapter2, Ri 1 stillexponentialingeneral.toseewhy,let'sconsiderasimpleexample.supposewe i,theorientationmatrixoflinkiwithrespecttothelocalcoordinatesystemof Figure22:Theplanari-linkchain ι 1 i 1 L 1 θ 1 L 0 θ Thereforetheorientationmatrixoflinkiwithrespecttoworldcoordinatesystemis 0@cos(i) sin(i) WeclaimthattheelementsofRicontainatleast2imanydierentsummationterms. Forexample, Ri=R0R01R12:::Ri 1 0 sin(0)sin(1).ingeneral,itiseasytoshowbyinductionthatricontainsallofthe termswiththeformf0(0)f1(1):::fi 1(i 1);whereeachfjcanbeeitherasinorcos containsthefourdierenttermscos(0)cos(1),cos(0)sin(1),sin(0)cos(1),and R2=0@cos(0)cos(1) sin(0)sin(1) cos(0)sin(1) sin(0)cos(1) function.intotalthereare2isuchterms.noticethatthecommonsubexpression sin(0)cos(1)+cos(0)sin(1) sin(0)sin(1)+cos(0)cos(1)1a(142) eliminationwouldnoteliminateanyofthese2itermssincenotwotermsarethesame. sin(i)cos(i)1a i (140) (141)
CHAPTER3.EFFICIENTSYMBOLICINTERFACE Thereforeevenaftercommonsubexpressionelimination,Riwillcontainatleast2i terms.however,ifwedon'texpandrisymbolicallybutinsteadevaluatematrices R0,R01,...,Ri 1 irstandthendomatrixmultiplicationnumericallywecancomputeri 61 inlineartime. isnotagoodideaunlessthenumericalmatrixmultiplicationismoreexpensivethan expandingandevaluatingthefullexpressions.wewillseethatthisisnotthecase wedon'texpandthem).togetherwithafewspecialoperatorsthatactonmatrices exceptinthemosttrivialexamples.weproposetousepositionvectorsandorientationmatricesasrstclasssymbolicvariablesinthesymbolicexpressions,(i.e., ThissuggeststhatexpandingthematricesasexplicitsymbolicfunctionsofDOFs paradigmcommonkinematicanddynamicexpressionscanberepresentedasasmall numberofoperationsonthejointpositionsandlinkorientations.theseexpressions areusuallysmallenoughtobesimplytypedin,andmoreimportantly,therearevery ecientwaystoevaluatetheseexpressions. andvectorswhichwillbedenedlaterinthischapter,wewillshowthatwiththis tem. algorithm.ourcontributionisthatweextendtheideatotheconstrainedoptimizationarenaandintegratethenumericaltechniquesintoasymbolicinterfacetoachieve anecientandgeneralsymbolicinterfacetotheoptimizationbasedanimationsys- AsimilarinsighthasbeenusedbyHollerbach[29]indevelopingafastdynamics Section2.12exceptthattherearenewtypesofvariablesandoperations. expression.thestructureofanevaluationtreeissimilartowhatwehaveseenin parserisgeneratedwithlexandyacc[1].itgeneratesanevaluationtreeforeach ThefullsyntaxofanexpressionisshownbelowbyusingYACCnotations.The 3.2TheLanguage :expr'+'expr expr'-'expr expr'*'expr expr'/'expr
CHAPTER3.EFFICIENTSYMBOLICINTERFACE '('expr')' '-'expr%precuminus fun'('expr')' 62 SUMA'['ID']''('expr')'/*sumoveralljointangles*/ SUML'['ID']''('expr')'/*sumoveralllinks*/ ITG'['const','const']'/*integral*/ VDOT'('ID','expr','expr')' VCROSS'('ID','expr','expr')' fun variable const ROWV'['const','const','const']'/*rowvector*/ COLV'['const','const','const']'/*columnvector*/ ;:SIN COS TG CTG EXP variable:dofvar LN '^'NUMBER/*exponent*/ SQR/*square*/ TRANS/*transpose*/ const:id posvar orivar ; torquevar NUMBER ID''ID
CHAPTER3.EFFICIENTSYMBOLICINTERFACE dofvar:dof''number'['order','time']' posvar:pos''id'['der','time','number','number','number']' 63 orivar:ori''id'['der','time']' torquevar:torque''id'['time']' torquevar:torque''number'['time']' POS''ID'['der','time']' order:number time :ID idornum:id der idornum NUMBER NUMBER ;:der' 'idornum Therearefourtypesofconstants:realnumbers,3Drowvectors,3Dcolumnvectors, providetheecienciesdiscussedabove. 3.2.1Constants Intherestofthissection,wewillexplainindetailtheinterestingextensionsthat and33matrices.arowvectorhastheformrowv[x,y,z],acolumnvectorhasthe formcolv[x,y,z]representingcolumnvector0b@xyz1ca,anda33matrixhastheform mat[a11;a12;a13;a21;a22;a23;a31;a32;a33].
NormalscalarvariablesrepresentingDOFfunctionsandtheirtimederivativesare CHAPTER3.EFFICIENTSYMBOLICINTERFACE 3.2.2Variables representedbydoflabel[d,t]wherelabelisthelabel(aninteger)ofthedof(recall 64 typesofvariablesareintroduced:positionvariables,orientationvariables,andtorque variables.apositionvariablehastheform:posname[der-info,t,x,y,z]where ofthederivative(withrespecttotime),andtisthetime.inaddition,threenew thateachdofhasalabel,seesection2.3),dis0;1or2representingtheorder der-infoisasequenceofintegersoftheform(i1;i2;:::;ip;j)whichstorethederivative (x,y,z)isthecoordinateofthispositioninthelocalcoordinatesystem,andnally informationrepresentingtheoperator@p nameisthelabelofthelinkatwhichthispositionislocated,tiseitherareal numberrepresentingaspecictimeorsimplythesymboltindicating\atalltimes", E(t)todenotetheworldcoordinateoftheendeectorattimet.ThenE(t), t].forexample,supposewehavethreelinkslabeledl1,l2,andl3.ifweuse centerofgravity,itcanbeomitted.thatis,wecansimplywriteposname[der-info, @i1@i2:::@ipdj _E(t),andE(t)canberepresentedasposL3[0;t;ex;ey;ez];posL3[1;t;ex;ey;ez]; dtj:when(x;y;z)representsthe endeectorrelativetothelocalcoordinatesystemofl3.thepartialderivative andposl3[2;t;ex;ey;ez];respectively,where(ex;ey;ez)isthecoordinatesofthe posl3[(2;3;1);t;ex;ey;ez]:howdowerepresentthepartialderivativeswithrespect tothetimederivativesofanglessuchas@_e(t) anypartialderivativeswithrespecttotimederivativesofanglescanalwaysbereducedtopartialderivativeswithrespecttoangles(withouttimederivatives).inmost @2canberepresentedasposL3[(2;1);t;ex;ey;ez];@2_E(t) caseswhereonlyuptosecondorderderivativesareunderconsideration,thefollowing @_2(t)?Actually@_E(t) 2(t)3(t)canberepresentedas formulasaresucientforthereductions: @_2(t)=@E(t) @2(t):Ingeneral, @E(t) @_E(t) @_(t)=0; @(t)=0; @_(t)=@e(t) @; (145) (143) (144)
CHAPTER3.EFFICIENTSYMBOLICINTERFACE @_E(t) @(t)=0; @_(t)=2@_e(t) @(t); (146) (147) 65 theorientationmatrixofthelinknameoritsderivativesincludingmixedpartialand timederivatives. Similarly,anorientationvariablehastheformoriname[der-info,t]whichdenotes Noticethatanorientationvariableisa33matrix,whileapositionvariableisa @E(t) @(t)=@e(t) @(t): (148) withrespecttotherotationalanglenamedidattimet.noticethattorquevariables 3Dvector.Forexample,iftheorientationmatrixoflinkL1intheworldcoordinate systemism1(t),then representedasfunctionsofpositions.thereasontointroducethetorquevariables arenotessentialtothissymbolicsystemsincetorques(generalizedforces)canbe Atorquevariablehastheformtorid[t],whichrepresentsthegeneralizedforce dm1(t) dt=oril1[1;t]: (149) istogaintheoptimumeciencyforcomputingtorquesandtheirgradientssince torquesarethemostexpensivequantities.wewillshowhowtoextendhollerbach's technique[29]ofcomputinglagrangianinversedynamicstoevaluatethegradientsof allthetorquesino(m2)time,whichistheoptimumsincewehavetoevaluateo(m2) entries.withoutsuchspecialtreatment,itwouldtakeo(m3)time. syntaxanddierentiationrules.similarly,commonmatrixandvectoroperationsare representquantitieslikekineticenergyandangularmomentumofarigidlink.given dened.inadditiontonormalmatrixoperations,weneedtwospecialoperationsto Manyoperationsonscalarvariablesandconstantsaredenedwiththeexpected 3.2.3Operations two33matricesm1andm2,andalinkl,wedeneoperatorsvdotandvcross asthefollowing: Vdot(L;M1;M2)=Z(M1(X C))(M2(X C))(X)dX (150)
CHAPTER3.EFFICIENTSYMBOLICINTERFACE andvcross(l;m1;m2)=z(m1(x C))(M2(X C))(X)dX wherexrangesoverthecoordinatesofallthepointsonthelinklinitslocal (151) 66 massdensityatx. ism,thentherotationalenergyoflis coordinatesystem,cisthelocalcoordinateofitscenterofmass,and(x)isthe anditsangularmomentumaboutitscenterofmassis GivenalinkLwithalocalcoordinatesystemandassumingitsorientationmatrix Itshouldbepointedoutthatthecomputationofbothintegralscanbereducedto 0:5Z(_ Z(M(X C))(_ M(X C))(_ M(X C))(X)dX=Vcross(L;M;_ M(X C))(X)dX=0:5Vdot(L;_M;_M); M): (152) threecolumnsofmasm1;m2andm3,andthethreecolumnsof_ thecomputationofinertialtensorsasdenedinsection2.5.toseewhy,denotethe _M3.AnddenoteX=0B@x1 Mas_M1;_M2and (153) R(_ =RP3i;j=1MiMj(xi ci)(xj cj)dx1dx2dx3 x2 x31caandc=0b@c1 =P3i;j=1MiMjR(xi ci)(xj cj)dx1dx2dx3 M(X C))(_ M(X C))(X)dXc2 c31ca:then andr(_ =RP3i;j=1MiMj(xi ci)(xj cj)dx1dx2dx3 M(X C))(_ M(X C))(X)dX (154) InordertocomputeR(xi ci)(xj cj)dx1dx2dx3forall1i;j3,allweneedis thematrix Z0B@x1 =P3i;j=1MiMjR(xi ci)(xj cj)dx1dx2dx3 (155) whichistheinertialtensormatrixofthislinkasdenedinsection2.5. x2 x3 1 1 CAx1x2x31dx1dx2dx3 (156)
CHAPTER3.EFFICIENTSYMBOLICINTERFACE 67 Figure23:Theplanar3-linkchainthrowingabasketball basket ball neoustransformationinsection2.5.inoursymboliclanguage,weneedtorepresent 3.2.4RepresentingKineticEnergy Wehavederivedformulastorepresentkineticenergyofalinkbyusingthehomoge- thekineticenergyintermsofthecentersofgravityandorientationmatrices.since thekineticenergyofarigidbodyisthesumofrotationalenergyandthekinetic energyofthecenterofgravity,thekineticenergyoflinklis 3.3AnExample Wegiveanexampletoshowalltheexpressionsinaspacetimeconstraintformulation +12Vdot(L;oriL[(1);t];oriL[(1);t]): 12trans(posL[(1);t])trans(posL[(1);t]) animateaplanarthreelinkarm(seefigure23)whichstartsbyholdingaballatthe endeector(or\hand")initsrestpositionattimet0,throwstheballattimet1, theballhastogointobasket. andcomesbacktoitsrestpositionattimet2.theadditionalrequirementisthat inthisnewlanguage.theexampleisextractedfrom[40].supposewewantto handis(hx;hy;hz).andletg=9:8bethegravityconstant.assumetisthetime periodduringwhichtheballiesfromleavingthehandtogettingintothebasket. Assumethebasketlocationis(Bx;By;Bz),thelocalcoordinateoftheendofthe L 1 θ 0 L 2 L 3 θ 1 θ 2 end effector
CHAPTER3.EFFICIENTSYMBOLICINTERFACE Therearethreetypesofconstraints: (1).Theballshouldgointothebasket. Theobjectivefunctionistheintegralofthesumofsquaresofthethreetorques. 68 upperandlowerboundwhicharestoredintheguredatastructure),sotheuser doesn'thavetoinputjointlimitconstraints. Usingourlanguage,theobjectivefunction,theintegralofthesumofthesquared (3).Eachjointanglehasalimitedrange. Thethirdconstraintisabuilt-inconstraint,(i.e.,eachrotationalanglehasan (2).Attimet0andtf,thearmisstillandinitsrestposition. torques,canbewrittenas constraint(1)is itg[t0;tf](sqr(tor0[t])+sqr(tor1[t])+sqr(tor2[t])); posl3[(0);t1;hx;hy;hz]+posl3[(1);t1;hx;hy;hz]t+ 0:5colv(0; g;0)tt=colv(bx;by;bz); (157) andconstraint(2)isrepresentedbytwelveequations, dof0[0;t0]=0;dof1[0;t0]=0;dof2[0;t0]=0; (158) dof0[1;t0]=0;dof1[1;t0]=0;dof2[1;t0]=0; dof0[0;tf]=0;dof1[0;tf]=0;dof2[0;tf]=0; (159) (160) [39]),wecanrepresenttheobjectivefunctionas Ifweinsteadusethechangeofenergyastheobjectivefunction(forexample,see dof0[1;tf]=0;dof1[1;tf]=0;dof2[1;tf]=0: (161) itg[t0;tf](sqr(m1trans(posl1[1;t])posl1[2;t] (162) +sqr(m2trans(posl2[1;t])posl2[2;t] +sqr(m2trans(posl3[1;t])posl3[2;t] +Vdot(L1;oriL1[1;T];oriL1[2;T])) +Vdot(L2;oriL2[1;T];oriL2[2;T])) +Vdot(L3;oriL3[1;T];oriL3[2;T]))) (163)
oneofthemajoradvantagesofasymboliclanguage.thesymbolicdierentiation Theabilitytoautomatethegradientcomputationusingsymbolicdierentiationis CHAPTER3.EFFICIENTSYMBOLICINTERFACE 3.4SymbolicDierentiation 69 canbecarriedoutessentiallythesamewayasthepreviousmethodasdiscussed insection2.12exceptthatwhiletheleavesrepresenteitherapositionoramatrix Thedierentiationformulaeofthesetwooperatorsaresimply variable,der-infoshouldbeupdatedusingthereductions(3)-(8)ifnecessary.forthe torquevariables,thepartialderivativeinformationisstoredinthenode,andwewill showhowtocomputethetorquesandtheirpartialderivativesecientlyatevaluation timeinthenextsection. and@vcross(l;m1;m2) Oneshouldalsonoticethattherearetwospecialoperators:VdotandVcross. @Vdot(L;M1;M2) @ @ =Vdot(L;@M1 =Vcross(L;@M1 @;M2)+Vdot(L;M1;@M2 @;M2)+Vcross(L;M1;@M2 @);@):(165) (164) gradientsoftorqueswithoptimumeciency. 3.5TorqueVariables Inthissection,weshowhowtoextendHollerbach'stechnique[29]tocomputethe LetWuvbetheorientationmatrixoflinkvinthecoordinatesystemoflinku,(i.e., LetD(l)bethesetofindicesofallthedescendentsoflinkl.LetD(l)=D(l)[flg. ofgravity.letg=(0;g;0)bethegravityvector.denoteujtobetheindexofthe linkwherejislocated(i.e.,jisoneofthedegreesoffreedomallowingthislink torotatearounditsparent).letk(l)bethesetofindicesofthechildrenoflinkl. LetWirepresentthe44transformationmatrixoflinki.Letribeitscenter therelationshipthatukiseitheranancestorofujoruk=uj.givenamatrixm,let respecttojis Wv=WuWuv).Fork2D(l),weuseRktodenoteWlk.Weuseukujtodenote tr(m)bethetraceofm.asshownin(46)ofsection2.5,thegeneralizedforcewith fj=x i2d(uj)(trf@wi @jji(wi)tg+mig@wi @jri) (166)
CHAPTER3.EFFICIENTSYMBOLICINTERFACE tives,weneedtousethefollowingintermediatevariables: Inordertoderivetherecursiveformulasforcomputingf(j)anditspartialderiva- Al=X i2d(l)wl ijiwt i; (167) 70 bl=x Bl;k=X i2d(l)miwl i2d(l)wl iji@wt iri; @k; (168) anddl;k=x Cl;k=X i2d(l)2wl iji@_wt @k; i (169) i2d(l)wl iji@wt @k: i (170) Sincefj=X Firstofall,weclaimthat fj=tr(@wuj @jauj)+g@wuj @jbuj (171) i2d(uj)(trf@(wujwuj i2d(uj)(trf@wi @jjiwt @jji(wi)tg+mig@(wujwuj i) ig+mig@wi @jri) (173) (172) =trf(@wuj @j)x i2d(uj)(wuj ijiwt i)g+g@wuj @jx i2d(uj)(miwuj @jri) iri) (174) whichisequation(172). =tr(@wuj @jauj)+g@wuj @jbuj; (175) itsrstandsecondorderderivativesare TheformulaforcomputingpartialderivativeswithrespecttoaDOFvariableand @fj @k=8><>:trf@2wuj @j@kauj+@wuj @jbuj;kg+g@2wuj @j@kbuj;ukuj (176) trf@2wuk @j@kauk+@wuk @jbuk;kg+g@2wuk @j@kbuk;otherwise (177)
CHAPTER3.EFFICIENTSYMBOLICINTERFACE and@fj @_k=trf@wuj @jcuj;kg; (178) 71 Toderive(177),whenukujwehave @k=trf@wuj @fj @k=x i2d(uj)\d(uk)(trf@2wi @jduj;kg:@j@kji(wi)t+@wi @jji@wt @kg i (179) =X@j@kri) +mig@2wuj +mig@2wi i2d(uj)(trf@2wuj @j@kwuj @j@kwuj iri) @jwuj iji@wt @kg i (180) =trf@2wuj +G@2Wuj @j@kx i2d(uj)miwuj i2d(uj)wuj iji(wi)t+@wuj iri @jx i2d(uj)wuj iji@wt @kg i (181) Theothercasewhenukisuj'sdescendentissimilar.Whatfollowsarethederivations of(178)and(179).from(173),wehave =trf@2wuj @j@kauj+@wuj @jbuj;kg+g@2wuj @j@kbuj: (182) @fj @_k=x i2d(uj)trf@wi @jji@wt @_kg i (184) (183) =trfx =trf@wuj i2d(uj)2@wuj @jx @jcuj;kg; i2d(uj)2wuj @jwuj iji@_wt @kg i (185) (186) (187)
CHAPTER3.EFFICIENTSYMBOLICINTERFACE =trfx @fj @k=x i2d(uj)@wuj i2d(uj)trf@wi @jwuj @jji@wt @kg (188) (189) 72 TherecursiveformulasforcomputingAl,bl,Bl;k,Cl;kandDl;kare =trf@wuj @jx @jduj;kg: i2d(uj)wuj iji@wt @kg i (190) bl=mlrl+x Al=JlWT l+x u2k(l)ruau; (192) (191) Bl;k=Jl@WT Cl;k=2Jl@_WTu2K(l)RuBu;k; @k+x u2k(l)rubu; (193) Dl;k=Jl@WT l@k+x lu2k(l)rudu;k; u2k(l)rucu;k; (194) (195) for(192).al=jlwt Thederivationsof(192)-(196)aresimilartoeachother.Soweonlygivetheone l+x i2d(l)(wl ijiwt i) (196) k2k(l)x i2d(k)(wlkwk ijiwt i) (199) (197) =JlWT l+x k2k(l)rkx k2k(l)rkak i2d(k)(wk ijiwt i) (200) (201) (198)
CHAPTER3.EFFICIENTSYMBOLICINTERFACE 73 Tocomputethegradients,foreachk,wetraversetheguretreetocomputeAl, Bl,Bl;k,Cl;k,andDl;kforalllbyusing(192)-(196).Then(172)-(179)areapplied tocomputethetorquesandalloftheirpartialderivatives.sointotal,thegradient computationtakeso(m2)time.noticethatwehavem2componentstoevaluate(the gradientofeachtorquecontainsmcomponents),soinaverageeachcomponenttakes constanttime.clearlythisistheoptimum. 3.6Evaluation Theevaluationoftheevaluationtrees(includingdierentiationtrees)beginswith thethevariablesattheleaves.thedofvariablesareevaluateddirectlyfromtheir representations(e.g.,b-splines,b-splinewavelets,piecewisehermitesplines,etc.). Fromthelastsectionwecanseethattheevaluationoftorquevariablesreduceto theevaluationoforientationmatrices,theirrstandsecondorderderivatives,and theirpartialderivatives.inaddition,itiseasytoseethattheevaluationofpositions andtheirtimeorpartialderivativescanbecomputedrecursivelyfromtheorientationmatrices.thus,allthatisneededistorecursivelycomputealltheorientation matrices,theirrstandsecondordertimederivatives,andtheirpartialderivatives. FormallyweneedtoevaluateWi,_Wi,Wi,@Wi @k@_wi @k@wi @kforalliandk. WehavegivenalgorithmstocomputeWiand_WiinSection2.4.ThecaseforWi issimilar,therecursionformulais Wi=W}iW}i i+2_w}i_w}i i+w}iw}i i: (202) wheretheformulaforw}i icanbeobtainedbydierentiating(33)insection2.4,the detailsareomitted. TherecursionformulaeforcomputingpartialderivativeswithrespecttoDOF variablesare @_Wi @j=@_w}i @jw}i i+_wi@w}i i @j+@w}i @j_w}i i+w}i@_w}i i @j (203) @Wi @j=@w}i @jw}i i+w}i@w}i i @j+2@_w}i @j_w}i i+2_w}i@_w}i i @j +W}i @jw}i i+w}i@w}i i @j (204)
Display CHAPTER3.EFFICIENTSYMBOLICINTERFACE 74 objective/constraints design objective/constraints (symbolic expressions) figure design parser symbolic differentiator keyframes DOF representation intermediate evaluation GUI (control panel) andthepartialderivativeswithrespecttothetimederivativesofthedofvariables Figure24:Thenewinteractivespacetimeconstraintssystem final evaluation BFGS canbecomputedusingthereductions(143)through(148). someexpressionsmayneedtobeevaluatedatmultiplesampletimepointstoevaluate integralexpression.toavoidredundantrecursivematrixevaluations,foreachtime expressionsatthistime. samplepointonecandoarecursivematrixevaluationonceandevaluateallthe Ingeneral,anoptimizationformulationmaycontainmultipleexpressions,and Withthenewsymbolicinterfaceinplace,theinteractivespacetimeconstraintssystem canbemodiedasshowninthefigure24.theintermediatestepevaluatesvariables Wi,_Wi,Wi,@_Wi 3.7InteractiveSpacetimeConstraintsSystemwith thenewsymbolicinterface @j,@wi @j,al,bl,bl;k,cl;k,anddl;kasdenedinsection3.5.thisstep
allthevariables(includingthedierentiationtrees)canbeevaluatedimmediately(in constanttime). CHAPTER3.EFFICIENTSYMBOLICINTERFACE takesm2timewheremisthenumberofdofs.afterthisintermediateevaluation, 75 3.8Experiments Teststocomparethecomputationtimeofthepreviousmethodandthisnewmethod wereconducted.thetestcasesarelinearchainswiththenumberoflinksrangingfrom eliminationasdescribedin[40].figure25(c)plotstheevaluationtimevs.the ofnodesoftheevaluationtreesvs.thenumberoflinksaftercommonsubexpression methodbeforecommonsubexpressionelimination.figure25(b)showsthenumber endeector.theresultsareshowninfigure25.figure25(a)showsthenumber ofnodesoftheevaluationtreesvs.thenumberoflinksusingprevioussymbolic 9to16.Eachjointhasonedegreeoffreedom.Theexpressionisthepositionofthe numberoflinksusingtheprevioussymbolicmethodwithcommonsubexpression elimination.figure25(d)showstheevaluationtimevs.thenumberoflinksusing ournewsymbolicmethod.notethechangesinscalesofthehorizontalandvertical axesẇecanseethatinthepreviousmethod,evenaftersubexpressionelimination, Thelineargrowthiscriticaltoallowingtheinteractivespacetimeconstraintmethods toextendtocomplexgures. theevaluationtimegrowslinearlyasexpected.figure25(e)zoomsinonthelower leftcornerofgraphs(c)and(d)toshowadirectcomparisonusingthesameaxes. boththenumberofnodesandtheevaluationtime(figure25(c))aregrowingexponentiallyasthenumberoflinksincreases.butifweusethenewsymbolicmethod, methodisgeneralenoughtorepresentthekinematicanddynamicquantitiesthatarise inthespacetimeconstraintmethodforanimatinglinkedgures.theevaluationofthe resultingsymbolicexpressionsandtheirgradientsareincomplexity,thesameasthe 3.9Conclusion Inthischapter,wehavedescribedanewsymbolicmethodandshowedthatthis
CHAPTER3.EFFICIENTSYMBOLICINTERFACE 76 500000 400000 40000 num_nodes (A) 300000 200000 num_nodes (B) 30000 20000 100000 10000 0 0 5 10 15 num_dofs 0 0 5 10 15 num_dofs 80 5000 (C) 100 microseconds 4000 3000 2000 1000 (D) 100 microseconds 60 40 20 0 0 0 5 10 15 0 20 40 60 Figure25:ComparisonsofpreviousCSEmethodandthenewsymbolicmethod num_dofs num_dofs 100 (A). Number of nodes before CSE. 80 old method (B). Number of nodes after CSE. new method 60 (C). Evaluation time after CSE using the previous method. 40 (D). Evaluation time using (E) the new method. (E). Evaluation time of both 20 methods when the depth of DOFs ranges from 0 to 10. The dashed curve is the new 0 0 2 4 6 8 10 method. num_dofs 100 microseconds
CHAPTER3.EFFICIENTSYMBOLICINTERFACE equivalentnumericalmethods.furthermore,theexpressionsareusuallyverysmall, sothismethodmakesageneral,easytouse,andecientinterfacetooptimization basedlinkedgureanimationsystems.currentlythesymbolicexpressionsareread 77 fromalewhichiscreatedbyhand.figure26isasnapshotoftheinterfacewherethe button\loadexps"atthebottomleftisusedtoselectaleandreadinthesymbolic expressions.clearly,workneedstobedonetoprovidemoregraphicallybasedand/or intuitivemeanstogenerate,modifyandinspectthesymbolicexpressions.
CHAPTER3.EFFICIENTSYMBOLICINTERFACE 78 Figure26:Thegraphicalinterface
Chapter4 KeyframeOptimization availabletosolvesuchnonlinearconstrainedoptimizationproblem.thischapter 4.1Introduction describesavariationofthefullspacetimeconstraintsmethodwhichusesusersupplied informationtoreducethecomplexityoftheoptimizationproblem. Inadditiontosymbolicprocessing,anotherbottleneckofthespacetimeconstraints systemisthenumericaloptimization.thenumberofunknownsandthenumberof constraintstendtobelarge.ingeneral,therearenoecientnumericalmethods 4.1.1TheIdea Figure27listschoicesofanimationparadigmsoutlinedinChapter1bytheirextent ofcontrolversusautomation,(theportionoftheworkwhichthecomputerdoes togenerateamotion).theapproachpresentedinthischapter(labeled\keyframe basedsystems.thecentralideaintheworkpresentedhereistomaintainasmuchof thesemanticsandcontroloeredbykeyframesystemsaspossible,whilestillproviding someofthebenetsofoptimizationbasedsystems. optimization")llsagapbetweensimplekeyframesystemsandotheroptimization couragetheiterativemodicationandevaluationoftheanimationdesignprocess. Reducingthecomplexityofthenumericalprocessisachievedinanumberofways: byreducingthedimensionalityofthespaceofpossiblesolutions,bycreatingamore Wealsowishtoprovideresultsatinteractivespeeds(i.e.,afewseconds)toen- 79
CHAPTER4.KEYFRAMEOPTIMIZATION 80 linearproblem,byconstrainingtheproblemmoretightly(implicitlyreducingthe spaceaswell),andbyprovidingabetterstartingguessforsolutions. Theobservationwemakeinreformulatingtheproblemtoachievethesegoals Figure27:Controlvs.Automation Keyframe Optimization isthattheanimatormayhaveagoodsenseofspecickeypositionsacharacter shouldpassthrough(thekeyframes).butingeneral,theinexperiencedanimator mayhavelessintuitionabouttheprecisetimingofthekeyframesandthevelocityof theindividualdofastheypasstheseunknownpointsintime.beyondtheimplicit constraintsofthekeyframes,theanimatormayalsoknowspecicinstancesofhigher levelconstraintsonthemotion.forexample,givenadesiretohavethegurejumpto acertainheight,theverticalvelocityofthecenterofgravity(cog)atthebeginning ofajumpcanbederived. 1.xtheuserspeciedkeyframedpositionsasconstraints,aswellasafewkey Basedontheseobservations,thesolutionweproposeisto 3.selectapiecewisecubicHermiteinterpolationbetweenkeyframesastheunderlyingrepresentationofthetrajectories,but thecenterofgravityforajump,orthevelocityofanendeectortoachievea 2.allowspecicationofotherhigherlevelconstraints,forexamplethevelocityof physicallyrealisticthrow,and timepointsselectedbytheanimator, 4.leavethetimeofmostkeyframesandtherstderivativeofeachDOFneededto Thesechoicessatisfythecriteriasetoutaboveinthatthey"trust"theanimatortopositionthecharacteratkeyframes.Thisleavesintactanyuserinterfaceforpositioning fullyspecifythehermitesegmentsasunknownstobesolvedforbyasimplied optimizationprocess. Control Keyframe * Spacetime constraints Automation Simulation Controller based
CHAPTER4.KEYFRAMEOPTIMIZATION thekeyframesthemselves.theanimatorisalsoimplicitlyxingtheamountoffreedomineachdoffunctionthroughthenumberofkeyframeschosen(i.e.,additional 81 keyframesinsertedautomaticallyincreasethefreedomintheresultingtrajectory). velocityunknownsperdofperkeyframe.thiscontrastswithprevioussystems whichsolveforanunknownnumberofpositionvaluesforeachdof.inaddition, inthisapproach,thevelocitytermsappearaslineartermsinanenergyfunctional asopposedtothequadraticpositionterms.thechoiceofpiecewisehermitecubic curvesforthetrajectoriesmatchesthemixofknownandunknownquantitiesinthe Theoptimizationproblemisgreatlysimpliedasthereareonlytimemarksand system(i.e.,knownposition,unknownvelocitiesandtiming). onlytodecidevelocitiesandthosetimemarksnotexplicitlyspeciedbytheanimator. Theseconstitutearguablythemostdicultpartofakeyframesystemtoproduce Comparedtoapurekeyframesystem,themethodoutlinedhereusesoptimization 4.1.2ComparisontoStandardKeyframingandConstrained agracefulandnaturallookingmotion.inessence,theseideasprimarilyreplacethe Optimization tobeimplementedinanykeyframesystem. interpolationstep(andtheparameter-to-time,i.e.\ease-in,ease-out"function)in traditionalkeyframesystems.sincetheoptimizationisfast,themethodiswellsuited boundaryvalueproblems.incontrast,weperformauniedsolutionoverasmany solvesthecompleteanimationfromasequentialsolutionofaseriesoftwo-point timeintervalsasdesired. keyframesisrelaxed.inthespacetimeconstraintsetting[56,13,40],theuserhadto Thismethoddiersfromtheoptimalcontrolinterpolationmethodof[7]which cost.itisinexpensivesincethereisonlyonetimevalueperkeyframe,thatis,itis specifywheneachconstraintwastohold1.ourexperimentssuggestthatleavingthe timingtotheoptimizationprocessresultsinsignicantlybetterresultsataminimal nottiedtothegure'scomplexity. Anotherfeaturewhichisdierentfrompreviousworkisthatthetimingbetween however,itisnotreportedassuch. 1Itappearsthatasimilarconceptmayhavebeenemployedinoneoftheexamplesin[56],
CHAPTER4.KEYFRAMEOPTIMIZATION thespaceofpossiblesolutionsrequiresmorespecicationfromtheanimator(i.e., thisisnotasystemforcreatingautonomouscreatures).theresultsarealsonot Thereare,ofcourse,disadvantagesintheproposedsystem.Thereductionin 82 reallydoesverylittlefortheanimator,sincethekeyframesprovidethebackbone systems,objectivefunctionssuchasminimizationofenergy,orotherphysicallybased objectivessuchasmaintainingbalancemustbespecied,andbeabletobeevaluated anddierentiated.finally,itcanalsobearguedthatthesystembeingproposed guaranteedtobephysicallyaccurate,asthespaceofsolutionsishighlyconstrainedby oftheanimationsequence.however,wewillshowthatthesubtletiesoftimingand thechoiceofkeyframes.furthermore,beyondwhatisprovidedinstandardkeyframe velocityaddsignicantlytothelifelikefeelingofananimation.althoughahighly cannot. 4.2SystemOverview Theanimationsystemcanbethoughtofeitherasakeyframesystemrelyingona skilledanimatormayhavetheabilitytodirectlyspecifythisalso,manyanimators spacetimeconstraintparadigmforinterpolationbetweenkeyframes,orasaspacetime constraintsystemtakingkeyframesasconstraints.thebasicstructureisdescribedin Figure24wheretheDOFrepresentationistheHermiterepresentation,thekeyframes areusedasconstraints,andaschemeisprovidedfortheusertox/relaxthevariables. ofindividualjointsorthroughtheuseofanyinversekinematicsmethod2thetime Higherlevelconstraintscanbespeciedaswell3.Forexample,theCOGofthegure oranendeectorcanbeconstrainedtohaveaspecicvelocityatsomekeyframe. pointsforafewkeyframesmayalsobexed,asmaybevelocities,ifsodesired. Theuserinteractivelydenesguresandmanipulatesthembychangingtheangles mumenergyobjective),theoptimizationprocessisrun,andtheresultingmotionis commercialsystemsandisnotdiscussedhere. symbolicmethodasdevelopedin[38]shouldprovideagoodinterfaceforsuchanimationsystem. 2Theinteractivesystemusedtotesttheideasinthisworkisquiterudimentarycomparedto 3Thereisnohighlevelinterfacedevelopedfortheexperimentsreportedinthispaper,butthe Giventheuserspeciedkeyframes,andanobjectivefunction(currentlyamini-
otherconstraints,andreruntheoptimizationprocedure. CHAPTER4.KEYFRAMEOPTIMIZATION displayed.atthispoint,theusermaygobackandmodifyoraddkeyframesand Theoptimizationprocessinvolvesiterativegradientcomputationandanoptimizationstep.Theoptimizationstepismadeeitherwithalinesearchalongthe 83 secondsarerequired. structedwiththebroyden-fletcher-goldfarb-shanno(bfgs)nonlinearoptimization algorithm[49,40]discussedinchapter2.typically3to10iterationsoffrom1to5 negativegradientoralongagradientmodiedbythepseudo-inversehessiancon- PiecewisecubicHermitesplines(seeSection2.8.1)wereselectedastheunderlying representationforthedoftrajectoriesduetotheirgoodmatchbetweentheanimator specicationandoptimizationparameters,andthehermitebasis.eachhermitesegmentisdenedbyendpointpositions(thekeyframes),endpointvelocities(unknowns 4.2.1HermiteInterpolationasDOFRepresentation keyframesplusthemtimevalues. tobedeterminedthroughoptimization),andendpointparametervalues(inthiscase time,alsotobedetermined).thus,formtimesegments,thereare2n(m+1)+m parametersintotal(thepositionandvelocityofeachofndofateachofm+1 isminimized. remainingvelocitiesarealsoprescribedbytheanimator,suchasperhapsstarting problem,thenistondthesen(m+1)+m(orfewer)parameterssothattheobjective thereareonlyhalfofthese,orn(m+1)+mremainingasunknowns.someofthe andendingatrest,asaresometimepoints,furtherreducingtheproblemsize.the Sincetheanimator'skeyframesaretakenasexplicitsolutionsforthepositions, Asimplesoccerplayerservesasanexampletodemonstratehowthisideaworks. Supposethesoccerplayer,startingfromaninitialstandingposition,istokickaball intothegoal,andreturntoastandingposition(seethemiddleoffigure32).the animatorhassomeintuitivenotionabouthowtokickaball,forexample,theplayer 4.2.2RelaxingSpeedandTiming swingshislegbackwardtoprepareforthekick,thenswingsitforwardtokickto
CHAPTER4.KEYFRAMEOPTIMIZATION 84 ball.thus,fourkeyframesaredenedwiththelegswungbackward,withtheleg Figure28:One-linkarmthrowingtheballintothebasket abouttokicktheball(inthiskeyframe,wemakesurethatthetoeisattheball's position),plusonekeyframeeachforthebeginningandnalstandingpositions.the timingofandvelocitiesthroughthemiddletwokeyframesisleftunspecied.the rstandlastkeyframesarexedbothintimeandwithzerovelocity.oneadditional constraintproblems.althoughthesolutionspaceisquiterestrictive,itisgenerally thethirdkeyframe.withthegureconstrainedtostartandstopatrest,weareleft withaverysmalloptimizationproblemwithonlythesecondandthirdvelocities,and thethreetimeintervalsasunknowns.these(2n+3)unknownsrepresentamuch smaller,albeitmorerestrictive,problemthanthosethatariseingeneralspacetime constraintrequiresthefoottohavesucientvelocitytokicktheballatthetimeof RelaxingTiming stillbigenoughtocontaingoodsolutions(givenreasonablekeyframesofcourse). Let'suseasimpleexampletodemonstratethefactthatrelaxingtimingcangenerate Inexperimentsbelow,asmoothandrealistickickingmotionofa3Dgurewith15 bettermotions. degreeoffreedomswasfoundin3secondsonansgir4000processor. (3.5).Assumethelengthofthelink,L,isequalto2.Thetaskistostartwiththe restposition(thearmisstraightdown,= =2)attimet0=0andthrowtheball infigure28.recallthatwehavederivedthespacetimeconstraintformulationin Supposethereisaonelinkarmwithonerotationaldegreeoffreedom,asshown
CHAPTER4.KEYFRAMEOPTIMIZATION 85 θ π π/2 2.0 3.5 t π a. T 1 =2.0, T 2 =3.5 θ π π/2 Figure29:=(t) 0.5 1.0 π b. T 1 =0.5, T 2 =0.5 t
CHAPTER4.KEYFRAMEOPTIMIZATION 86 Figure30:MotionsequencewhenT1=2:0andT2=1:5
CHAPTER4.KEYFRAMEOPTIMIZATION 87 Figure31:MotionsequencewhenT1=0:5andT2=0:5
CHAPTER4.KEYFRAMEOPTIMIZATION attimet1andcomebacktoitsrestpositionattimet2.suppose(t1)= =2+=4, whichhasbeenxedbytheuser.supposebxandbyandtarechosensuchthat _(t1)mustbeequalto4:0inorderfortheballtomakethegoal.denotet1=t1 t0, 88 andt2=t2 t1.noticethatover[t0;t1],isdeterminedbyt1,andover[t1;t2],is determinedbyt2. theball,quicklydecelerates,andmovesbackwardtoitsrestposition.themotionis isshowninfigure29(b).thecorrespondingmotionsequenceisshowninfigure31. Thetimeintervalbetweeneachframeis0:1.Foreachframe,wealsodrawtheball sothatwecancomparethevelocityoftheballwiththatofthearmaroundthe momentofthrowing.wecanseethatthearmmovesforwardimmediately,throws IfwechooseT1=0:5andT2=0:5.UsingHermiteinterpolation,(t)over[t0;t2] theballisnotdrawntosavespace).again,thetimeintervalbetweeneachframe is0:1.inthiscase,thearmrstlymovesbackwardslowlytoobtainsomepotential, motionsequenceisshowninfigure30(thelengthofthearmisscaleddownand andthenacceleratesforwardtoachievethespeedandheighttothrowtheball.after achievesitsminimum,theresultingtrajectoryof(t)isshowninfigure29(a).the veryrigid.butifwechooset1=2:0andt2=1:5,atwhichtheobjectivefunction backwardtoitsrestposition.thismotionismuchmorenaturalthantheprevious one. 4.3KeyframeOptimization throwing,itcontinuestomoveforwardandslowdowngraduallyandnallymoves dueinparttothefactthatasimplisticinterpolationofthekeyframesalreadyplaces problems,wehavefoundapuregradientdescentisallthatisrequired.eachiteration consistsofalocalgradientdeterminationfollowedbyabisectionlinesearch(see,for example,[49])alongthenegativegradient.theabilitytousesuchasimplesystemis BFGSdefaultstoasimplegradientdescentfortherstiteration.Infact,forsmall TheoptimizationusedinthisworkisastandardBFGSquasi-Newtonsolver[49]. goalconstraint(seethenextparagraphforthereason)asopposedtothepositions thesolutionnearalocalminimum,andthusinawellbehavedregionofthesolution space.inaddition,theunknownvelocitiesofthedofappearaslineartermsinthe
levelconstraintsarenonlinear,however,theinitialvaluesimpliedbytheanimators keyframesprovideasucientstartingpointforalocaldownhillsearch. CHAPTER4.KEYFRAMEOPTIMIZATION thatappearasnonlineartermsinageneralsystem.thetimevaluesandhigher 89 conguration,thelefthandsideisalinearfunctionof_(t). constraintbecomesj(t)_(t)=v.sincej(t)isaconstantmatrixduetothexed goalconstraintisthefollowing.afterthecongurationisxed,thegoalconstraintis aconstraintonthevelocityoftheendeectororthecenterofgravitywiththeform P(t)=V.Noticethat ThereasonthattheunknownvelocitiesoftheDOFappearaslineartermsinthe 4.4ResultsP(t)=J(t)_(t)whereJisthewell-knownJacobimatrix,the Aseriesofexperimentswereconductedontwogures.Therstisatruncated3D aball.ineachcase,shortanimationsegmentswereexplored.transitionsbetween human-likegurewith2legs(jointedattheknees),apelvisandabody,withatotalof 15rotationaldegreesoffreedomplustranslationandrotationwithintheenvironment. Thesecondgureisamorecompletehumanlikecreaturewith29internalDOF.There isagroundplaneandaballwithwhichtheguresinteract.theexperimentsinvolved evenlyspacedintervals.thevelocitiesforthisinterpolationaretakenfromthecentral jumping,landingfromajump,walking,running,andmotionthrowingandkicking nitedierencesbetweenpreviousandfuturekeyframes(orforwardorbackward segmentswerealsoexploredwiththesametechniques,forexampletransitioningfrom walkingtorunningtokickingaball. dierencesatendframes).onewouldexpectaskilledanimatortodobetterthan thisonarstpass,however,itserveswellasastartingpointfortheoptimization. Arstguessinterpolationcanbefoundbyxingthetimesofthekeyframesat machine.thedominantportionofthetimewastakenbygradientcomputationand objectiveevaluationduringthelinesearch.solutionsforshortsegmentswereoften foundinonlytwoiterations,however,somecontinuedtoimprovefor10iterations. simplegureand4to5secondsforthemorecompletegureonanr4000sgi Ingeneral,eachoptimizationiterationtookapproximately1to2secondsforthe
CHAPTER4.KEYFRAMEOPTIMIZATION 90 Jump Keyframes Jump Results Kicking Keyframes Kicking Results Figure32:Motionsequences Throw Results Color Plate: Jumping, Kicking, Throwing From: Keyframe Motion Optimization by Relaxing Speed and Timing by: Zicheng Liu and Michael F. Cohen
CHAPTER4.KEYFRAMEOPTIMIZATION tion,swingbackward,swingforward,takeo.thecenterofgravityisconstrainedto haveadesiredupwardvelocityattake-o.thepositionofthecogisbasedonfree Therstexampleisajumper.Therearefourkeyframes:aninitialrelaxedposi- 91 ightdynamicsafterleavingtheground.theoptimizationprocessdeterminesthe velocitiesatthesecond,third,andfourthframesandthethreetimesegmentlengths arerelaxed(48unknowns).sixiterations(about10seconds),resultinarealistic jumpingmotionwithdesiredtakeovelocityresults(seetopoffigure32). gureisrequiredtoland,absorbtheenergyofthefall,andthenstandup.there arethreeframes:landing,followthrough,andstandingup.fouriterationsresultin anaturallookingmotion. Asimilarlandingsequencewasalsodetermined.Giventhelandingvelocity,the congurationwiththefootdrawnback,andthethirdonerepresentswhenthefoot position,theplayerkickstheball(hopefully)intothegoalandcomesbacktohisrest position.theball'smotioniscomputedfromsimplenewtonianphysicsassuming itsimplytakesonthevelocityofthefootatimpact.therearefourkeyframes: therstandfourtharetrivialrestconguration.thesecondoneistheprekicking Thesecondexperimentlooksatasoccerplayer.Initiallyinastandingatrest strikestheball.aconstraintissetforthevelocityofthefootatthethirdkeyframe soastokicktheballintothegoal. ananticipatorybendofthekneeandafollowthroughthatprojectstheballwith desiredvelocity(seemiddleoffigure32). Thetotalof33variablesaredeterminedintwoiterationsresultinginakickwith constantandwiththefullmodel.theabilitytorelaxthetimevaluesshowsa markedimprovementinndingalowerenergy(andmorenaturallooking)solution. bottomoffigure32).asinthekickingmotionthereare4keyframes,andaconstraint forthevelocityofthehand.experimentswererunbothholdingthetimepoints TheroughlydoublednumberofDOFledtoapproximately5seconditerations,with Furtherexperimentswererunonathrowingmotionwiththelargergure(see thesolutiontaking20iterations.thegradientdeterminationisatworstquadratic inthesizeofthetreedescribingthegure. soccerplayerwalks,thenrunsandnallykickstheballintothegoaltoscore.the Amultisegmentmotionwasconstructedstartingfromastandingposition,the
CHAPTER4.KEYFRAMEOPTIMIZATION run,walkandkickmotionsarecreatedrst.thenthethreetransitionmotionsare created:frominitialstandingtoaperiodicwalk,fromwalkingtorunning,andfrom runningtothekick.transitionphasesmaytaketheirrstandlastkeyframesfrom 92 othersegmentsandmayattheanimator'sdiscretionhaveintermediatekeyframes specied.eachpieceofthemotionincludingtransitionsisindividuallyoptimized, 4.5Conclusions Thegoalofcombiningintuitiveusercontrolwithautomatedsolutionsforanimation andtheresultsaresplicedtogether.eachindividualparttookfrom2to6iterations, orabout3to10secondsofcputime. sequencesisadelicatebalancingact.thischapterhaspresentedanewanimation addition.thedoffunctionsarerepresentedbypiecewisehermitesplines.initial theoptimizationisdistinctfromothersystemsandhasproventobeanimportant additionalkeyconstraintsonthegure'smotion.thevelocitiesandtimingare thencomputedbyanoptimizationprocess.theinclusionofthetimepointswithin paradigmtoachieveagoodbalanceinthiscontinuum.theanimatorisrequired resultsoftheuseofsuchasystemwerereported. tospecifykeyframesforwhichheintendstheguretopassthrough,aswellasany Hermiterepresentationandthegradientcomputationareeasytoimplement,this methodcanbeintegratedinanykeyframesystem. creategracefulandrealistic3dcomplexgureanimations.inaddition,sincethe enoughforuseinaninteractivesetting.ithasbeenshowntobeabletoeectively Thisparadigmeectivelyunburdenstheoptimizationprocesssothatitrunsfast
Chapter5 HierarchicalSpacetimeControl constraintproblemmoreecientlybyusingawaveletrepresentation.aswewilldiscuss,thismethodachievesbothfasterconvergenceandfasteriterationsthanprevious methods.thisworkhasbeenreportedinthepaper[40]. 5.1Introduction Inthischapter,wedescribeahierarchicalschemetosolvethegeneralspacetime AsdescribedinSection2.7,solvingthespacetimeconstraintproblemrequiresrestrictingthesolutiontosomenitedimensionalfunctionspace,leadingtoanite numberofscalarunknowns.thepossibletrajectoriesaparticulardofcantakeare thusrestrictedtobealinearcombinationofbasisfunctionschosentorepresentthe DOFmotioncurve.Inthepreviouschapter,werestrictedthesolutiontoacombinationofasmallnumberofHermitebasisfunctionsindirectlyindicatedbytheuser. Inthischapter,weremovethisrestrictionbyreturningtothemoregeneralproblem 5.2HierarchicalB-splines systemstodate,witkinandkass[56]useddiscretizedfunctionsconsistingofevenly usingnbasisfunctions, wherethecoecientsciscalethebasisfunctionsi(t).inthespacetimeconstraint (t)=nxi=1cii(t) 93 (205)
provisiontochangetheresolutionoftheb-splineswithinspeciedregionsofthe CHAPTER5.HIERARCHICALSPACETIMECONTROL spacedpointsintimefromwhichderivativeswereapproximatedbynitedierencing. CohenrepresentedtheDOFfunctionsasuniformcubicB-splinecurves,withsome 94 intermsofcomputationalresourcesforthisextrafreedom.theextraunknown thespaceofpossiblesolutions.unfortunately,fortworeasons,onepaysahighcost curve. coecientstranslateintolargersubproblemsateachiterationofthesolution.in addition,discretizationsofthistypealsoleadtoill-conditionedsystemsrequiring moreiterationstosolve[53]. Themorebasisfunctionsandcorrespondingcoecientsthatareused,thelarger inthetrajectoriesastheiterativesolutionproceeds. narrowerbases.unfortunately,theoptimaltrajectoriesarenotknowninadvance andthusamoreexiblebasismustbedevelopedthatcanadapttothelocaldetail bewiderandinregionswherethetrajectoryvariesquickly,thereshouldbemore, analmostoptimalanswer.insmoothportionsofthetrajectories,basisfunctionscan Ideally,onewouldliketoselectafunctionspacewithjustenoughfreedomtoallow basisfunctionsbelow. splinebasisconsistsofapyramidoftranslationsanddilationsofb-splines(therows labeledvinfigure33)rangingfromverywideb-splinesatthetoptonerscaled calb-splineshavebeenusedinthecontextofshapedesign[23]toallowmodication ofcurvesandsurfacesatlevelsofdetailselectedbytheuser.thehierarchicalb- Hierarchicalsystemsofbasisfunctionsoerjustthistypeofadaptivity.Hierarchi- Thishierarchicalbasishasattractivepropertiesforuseindescribingthetrajectories inthecurrentapplication.however,thisisaredundantbasis,sinceanyfunction realizableatonelevelcanalsobecreatedfromthenerbasisfunctionsbelow.in addition,howtoachievethedesiredadaptivityisnotimmediatelyapparent. Eachlevelgoingdowncontainstwiceasmanybasisfunctionsperunitlength.
CHAPTER5.HIERARCHICALSPACETIMECONTROL 95 V 5.3Wavelets W Amoreelegantandconcisehierarchicalbasis,andonethatleadsnaturallytoan Figure33:HierarchyofB-splineandWaveletBases. L 2 L 2 V L 1 W L 1 V L. V = V W L L 1 + eachnewlayerisnotredundantwiththoseabovebutratheraddsonlylocaldetailin advantagesofwaveletsandwaveletformulationsinthespacetimeanimationproblem. adaptivebasis,isoeredbyawaveletconstruction.thissectionconcentratesonthe theresultatsomeresolution. todirectlyrepresentingthelocalfunctionvalue.also,unlikehierarchicalb-splines, waveletcoecientsateachlevelrepresentdierencesfromthelevelsaboveasopposed TheprimarydierencebetweenwaveletsandhierarchicalB-splinesisthatthe 5.3.1AdvantagesofWaveletstoSpacetimeAnimation L 1 Thewaveletconstructionresultsinanon-redundantbasisthatprovidesthemeansto beginwithalowresolutionbasisandthenadaptivelyrenetherepresentationlayer basisfunctionswithresultingcoecientsgreaterthansomewillhaveasignicant bylayerwhennecessarywithoutchangingtherepresentationabove.ifrenements arerequiredinonlypartoftheinterval,thenonlythosecoecientswhosebaseshave supportinthisregionneedtobeadded. torythecoecientsencodingnerscaledetailwillbenearlyzero.thus,onlythose Sincethewaveletcoecientsencodedierences,insmoothportionsofthetrajec-
function[26,25],(discussedlater)thatcanpredictwhichcoecientswillbeabovea threshold,onlythecorrespondingsubsetofwaveletsneedstobeincluded. CHAPTER5.HIERARCHICALSPACETIMECONTROL inuenceonthecurveandtherestcanbeignored.inotherwords,givenanoracle 96 waveletbasisprovidesabetterconditionedsystemofequationsthantheuniform unknowncoecientsinthewaveletbasisprovidefasteriterations.inaddition,the B-splinebasis,andthusrequireslessiterations.Theintuitionforthisliesinthe dependsonthenumberofunknowncoecients.thesmallernumberofsignicant involveaseriesofquadraticsubproblemsforwhichthecomputationalcomplexity Solutionstothenon-linearspacetimeproblem,asdiscussedinmoredetailbelow, factthatthereisnosinglebasisintheoriginalb-splinebasisthatprovidesaglobal estimateofthenaltrajectory(i.e.,thelocalityoftheb-splinebasisis,inthiscase, adetriment).thus,iftheconstraintsandobjectivedonotcauseinteractionsacross pointsintime,theninformationaboutchangesinonecoecienttravelsveryslowly sometestresultsonquadraticfunctionsshowingthatusingawaveletrepresentation isusuallyfasterthannon-hierarchicalrepresentationswhenboththesolutionandthe (ino(n)iterations)tootherpartsofthetrajectory.incontrast,thehierarchical initialguessaresmoothfunctions.fornonsmoothfunctions,especiallywhenonlythe therelatedhierarchicalmethodsdiscussedhere.inthenextsection,wewillreport waveletbasisprovidesashorter(o(log(n)))\communication"distancebetweenany nestdetailcoecientsaresignicant(i.e.,thereisnoreasonableglobalestimate), twobasisfunctions.thisisthebasicinsightleadingtomultigridmethods[53],and samplingdensityonlyneedstobeincreasedintheseareas. resolutionresults,bydenition,inasmoothertrajectory,lesssamplesmustbetaken duringthenumericalquadrature.aswaveletsareaddedinparticularregions,the smoothsothatwaveletrepresentationachievesfasterconvergence. thewaveletrepresentationwillnotperformwell.butinpractice,functionsareusually levelsolutionandonlyworkondetailssimplybyremovingthecoarserlevelbasis Finally,thewaveletrepresentationallowstheusertoeasilylockinthecoarser Anadditionalbenetinvolvestheintegrationoftheobjective.Sincealower functionsfromtheoptimization.thisprovidesthemeanstocreatesmallsystems thatsolveveryrapidlytorenethenestdetailsinthetrajectories.
Inthissection,wereportsometestresultsonasimplequadraticfunctiontoshow CHAPTER5.HIERARCHICALSPACETIMECONTROL 5.3.2QuadraticFunction thatthewaveletrepresentationleadstofasterconvergence. 97 solutionisclearly=. where(t)andf(t)areknownfunctions,andf(t)>0forallt2[0;1].theoptimum Suppose Theoptimizationproblemconsideredissimplyto minimizez1 (t)=2l 1 Xj=0cjL;j 0((t) (t))2f(t)dt (206) insection2.9.1,andlissomegiveninteger.ifwealsorepresent(t)asalinear combinationofthesebasisfunctions,thatis, whereisthescalefunctionusedinthehaarwaveletconstructionasdescribed (t)=2l 1 Xj=0cjL;j; (207) thenr10((t) (t))2f(t)dt=r10p2l 1 =R10P0i;j2L 1(ci ci)(cj cj)l;il;jf(t)dt j=0(cjl;j cjl;j)2f(t)dt j=0(cj cj)2l;jf(t)dt (208) wherethethirdequalityholdsbecauseforallt2[0;1] L;i(t)L;j(t)=8<:0i6=j j=0(cj cj)2rj+1 2Lf(t)dt j (209) Letc=(c0;c1;:::;c2L 1)T,c=(c0;c1;:::;c2L 1)T,and M=0B@f0f1...f2L 1 1i=j 1 (210) CA (211)
CHAPTER5.HIERARCHICALSPACETIMECONTROL wherefj=rj+1 Z1 0((t) (t))2f(t)dt=(c c)tm(c c) 2Lf(t)dt.Then j (212) 98 Sotheproblem206becomesaquadraticminimizationproblem: thecoecientsofthesebasisfunctions.section2.9.1showedthatthereisalinear j2l 1;0lL 1g(seeSection2.9.1)torepresent(t).Denotedtobe Wedenotethisproblemby@(M;c). AsshowninSection2.9.1,wecanalsouseHaarbasisfunctionsf0;0g[f minimize(c c)tm(c c): l;jj0 (213) then(c c)tm(c c)=(d d)tutmu(d d) transformation(pyramidtransformation)betweencandd.denoteutobethematrix suchthatc=ud.letdbethehaarwaveletbasiscoecientsof,thatis,c=ud, randomlypicknumbersfrom[20 l0:1;20+l0:1]toformavectorc0whichisused numbersfrom[10 k0:1;10+k0:1]toform100c's,andthenforeachc,we Sotheproblem@(M;c)istransformedintotheproblem@(UTMU;U 1c). Inourexperiments,L=4.foreachk;l2f1;3;5;7;9;11g,werandomlypick (214) bothproblemsfor10iterations,andcomparetheobjectivefunctionvalues.theone weusew(l;k)todenotethenumberoftimesthat@(utmu;u 1c)isfasterthan astheinitialguessfor@(m;c).theinitialguessfor@(utmu;u 1c)isU 1c0. withthesmallerobjectivevalueisconsideredtobefaster.amongthe100tests, @(M;c).Theresultsareinthetable1. Fromthetablewecanseethatusingwaveletbasisisusuallyfasterthanusing Thenwerunthegradientdecentoptimizationalgorithm(seeSection2.10.1)on fasterthanaatbasis. smoothfunctionsasinitialguessestoachievefastconvergence. [10 k0:1;10+k0:1],thesmallerthek,thesmootherthefunction.therefore, thistablebasicallyshowsthatwhenissmooth,thewaveletrepresentationisusually boxbasiswhenkissmall.sinceeachcomponentofcisrandomlychosenfrom Thistablealsoshowsthatwhentheoptimumsolutionissmooth,weshouldchoose
CHAPTER5.HIERARCHICALSPACETIMECONTROL lnk1357911 190806337175 387756341236 99 5797261442714 thewaveletbasisisfasterthantheboxbasis. Table1:ComparisonoftheconvergencespeedsofusingHaarbwaveletbasisvs.using boxbasis.eachentryw(l;k)representsthenumberoftimesamong100teststhat 7696251402113 9635948352512 11534740322015 5.3.3ChoiceofWavelets weneedtocomputesecondorderderivatives.thesemi-orthogonalitypropertyresults waveletsbecauseoftheirsmoothness(theyhavecontinuoussecondorderderivatives), semi-orthogonalityandcompactness.therequirementforsmoothnessisobvioussince ThewaveletbasiswechooseisChui-WangB-waveletbasisonboundedintervalas inbestapproximationsoffunctions.thedesireforcompactnessisforlocality. describedinsection2.9.3.wechoosewaveletsonboundedintervalbecauseanimation problemsareconsideredoversomenitetimeinterval.wechoosechui-wangb- Onenalissueisthescalingratiobetweenthebasisfunctions.Traditionally[12]the 5.3.4Scaling waveletfunctionsaredenedwiththefollowingscaling: arescaled1 i;j(t)=2(i L)=2(2(i L)t j) bewellconditioned[15]itisadvantageoustoemphasizethecoarserlevelsandhence foroptimizationpurposesitiscounterproductive.fortheoptimizationprocedureto Thismeansthatateachlevelup,thebasisfunctionsbecometwiceaswide,and p2timesastall.whileinmanycontextsthisnormalizingmaybedesirable, (2(i L)t j) (215)
CHAPTER5.HIERARCHICALSPACETIMECONTROL usethescalingdenedby i;j(t)=2l i(2(i L)t j) (2(i L)t j) (216) 100 5.4Implementation Theinputtothewaveletspacetimeproblemincludesthecreaturedescription,theobjectivefunction(i.e.,symbolicexpressionsofjointtorquesgeneratedfromthecreature multiplyingallofthehandgentriesby2. wherethewiderfunctionsarealsotaller.inthepyramidcode,thisisachievedby ures,onecanuseeitherthesymbolicsystemasdescribedinfigure19ortheone asdescribedinfigure24.forlargegures,thelateroneistheonlyfeasiblechoice. Sinceourexperimentsonlyusesmallgures,wehavechosentousetherstsymbolic method.asdiscussedinsection2.12,thesymbolicexpressionsaredierentiatedand description),anduserdenedconstraintsspecifyingdesiredactions(throw,catch, compiledintodags. etc.),andinequalityconstraintssuchasjointlimitsontheelbow.forsmallg- Atthispoint,aconstrainedvariationalproblemisdened minimizef(;_;) unknownsarethentheb-splinecoecients,c,ortheequivalentwaveletcoecients, whereisthevectoroftrajectoriesofthedegreesoffreedomofthecreature. Eachtrajectory,(t),isrepresentedintheuniformcubicB-splinebasis.The subjecttoci(;_;)=0;i2neq Ci(;_;)0;i2nineq (217) w,scalingtheindividualbasisfunctions.thisnitesetofcoecientsprovidethe informationtoevaluatethe(t),_ (t),and BFGSmethodisusedtosolvetheresultedunconstrainedoptimizationproblem. strainedoptimizationproblemintoanunconstrainedoptimizationproblem.the constrainednon-linearoptimizationproblem. ofthedags.thisniterepresentationtransformsthevariationalproblemintoa ThepenaltymethodasdescribedinSection2.10.3isusedtotransformthecon- (t)atanytimet,thatcomprisetheleaves
oftheinverseofthehessian(usuallyanidentitymatrixleadingtotherstiteration CHAPTER5.HIERARCHICALSPACETIMECONTROL (thatcanbederivedfromb-splinecoecientsusingcoefpyrmup)andaguessh0 BFGSiterationsbeginwithauserprovidedinitialguessofwaveletcoecientsc0 101 thebroadb-splinesandasinglelevelofwavelets,aftereachiterationasimpleoracle beingasimplegradientdescent). function(seethenextparagraph)maybecalledtoaddwaveletsatnerlevelsonly putedandthenew(better)solutionwkisobtained.thissolutioncanbetransformed backtob-splinecoecientsbyusingcoefpyrmdownfordisplay. Iftheinitialfunctionspaceisrestrictedtoacoarserepresentationconsistingof Ateachiteration,thegradientwithrespecttothewaveletcoecientsarecom- sucientdetailinthoseregionsthatrequireit. renethedofrepresentation.todecidewheretoaddcoecients,foreachwavelet coecientwl;j(ofthebasisfunction whenthewaveletcoecientaboveexceedssometolerance.thisprocedurequickly,theoracleaddsallthecoecientswl+1;kofthenerlevelwaveletbasisfunctions approximatestheoptimaltrajectoryandsmoothlyconvergestoanalanswerwith l+1;jwhosesupportsaresubsetsofthesupportof Eachtimewhentheoracleiscalled,itaddswaveletcoecientsatnerlevelsto l;j)whoseabsolutevalueisbiggerthansome achieved,thustheoracleiscalledsothattheoptimizationprocesscontinuesata nerrepresentation. canbeassumedthatthelocalminimumatthecurrentresolutionhasbeennearly bedecidedbycheckingtheprogressoftheoptimizationprocess.ifthethedierence oftheobjectivefunctionattwoconsecutiveiterationsisbelowsomethreshold,it l;j.whentocalltheoraclecan whichrepresentlocalminimainthesameoptimizationproblem.thenextiteration framesystemtohelpguidethenumericalprocess.thisiscriticaltoallowtheuser, implementation.theusercandirectlymodifythecurrentsolutionwithasimplekey forexample,tomovethesolutionfromanunderhandtoanoverhandthrow,bothof thenbeginswiththesenewtrajectoriesasthecurrentguess. Animportantfeatureofthesystemdiscussedin[13]isalsoavailableinthecurrent
CHAPTER5.HIERARCHICALSPACETIMECONTROL 5.5Results Asetofexperimentswasrunontheproblemofathree-linkarmandaball(see Figure35).Thegoalofthearmistobeginandendinarestpositionhanging 102 straightdown,andtothrowtheballintoabasket.theobjectivefunctionisto minimizeenergy,whereenergyisdenedastheintegralofthesumofthesquaresof thejointtorques.gravityisactive. theconvergencewithb-splinerepresentation,fullwaveletrepresentationandadaptive waveletrepresentation,respectively.eachplotdiersonlyinthestartingtrajectories ofthearmdof.eachrunconvergedtoeitheranunderhandoroverhandthrow intothebasket.thefullb-splinebasiscontained67basisfunctionsforeachof armandballexample.theshortdashedline,solidlineandlongdashedlinerepresent ThefourgraphsinFigure34showtheconvergenceoffourdierenttestrunsofthe conditioningoftheb-splineformulation. Convergencewasachievedoneach,butonlyaftermanyiterationsduetotheill- thethreedof,thustherewere201unknowncoecientstosolvefor.iterations tookapproximately7secondseachonansgiworkstationwithanr4000processor. adaptivewaveletmethodwiththeoraclewasthefastestsincethenumberofunknownswassmallinearlyiterations,leadingtoaveryfastapproximationofthenal Thefullwaveletbasisalsocontained67basisfunctionperDOF(11B-splines formulationsovertheb-splinebasis,duetobetterconditionedlinearsystems.the atthetopleveland56waveletsbelow),thusiterationsalsotookapproximatelythe same7seconds.figure34clearlyshowstheimprovedconvergenceratesofthewavelet trajectories,inadditiontothebetterconditioningprovidedbythehierarchicalbasis. Thenalfewiterationsinvolvedmorewaveletsinsertedbytheoracletocompletethe whomakestheshot.thisanimationwascreatedinstages:rstplayerathrowsthe wasachievedinlessthanaminuteofcomputation. (seefigures35,36)wasanimated.thetaskwasa\giveandgo"play.playerapasses theballtoplayerb,thenmovestowardsthebasket.playerbpassesitpacktoa process.notethatineachcase,agoodapproximationtothecompleteanimation balltoalocationsetbytheuser,thenplayerb'sactionsareanimatedtocatchthe ball,thenplayerb'sthrowisanimatedfollowedbyplayeracatchingthisthrowand Ashortsequenceinvolvingtwobasketballplayerswithsixdegreesoffreedomeach
CHAPTER5.HIERARCHICALSPACETIMECONTROL 103 500 500 400 400 300 300 cost cost 200 200 100 100 0 0 100 200 300 400 time 0 0 100 200 300 400 time 500 500 B spline Full Wavelet Figure34:ConvergenceofArmandBallexamplefor4dierentstartingtrajectories. 400 400 Therstandfourthexamplesresultedinunderhandthrows,andtherestoverhand. Adaptive Wavelet Timeisinseconds,andthecostisaweightedsumofconstraintviolationsandenergy 300 300 abovethelocalminimum. 200 200 100 100 0 0 0 100 200 300 400 0 100 200 300 400 time time cost cost
CHAPTER5.HIERARCHICALSPACETIMECONTROL 104 makingthebasket.eachstageoftheanimationtookbetween10and25iterationsof Figure35:Aplanarthree-linkarmanda6DOFbasketballplayer. approximately6-10secondseach.thelongeriterationtimesareduetothe6dofof eachcreatureleadingtotwicethenumberofunknowns.figure37showsthemotion sequence. 5.6Conclusion ThespacetimeconstraintsystemrstsuggestedbyWitkinandKass[56]foranimating linkedgureshasbeenshowntobeaneectivemeansofgeneratinggoalbasedmotion. Cohenenhancedthisworkbydemonstratinghowtofocustheoptimizationstepon windowsofspacetimetodolocalrenement.thischapterhasextendedthisideato ageneralhierarchicalscheme. three-linkarmandtwosixdof\basketballplayers". waveletbasis.thisresultedinfasteroptimizationiterationsduetolessunknown iterationsarerequiredtosettletoalocalminimum.resultsareshownforaplanar coecientsneededinsmoothregionsofthetrajectory.inaddition,evenwiththe samenumberofcoecients,thesystemsbecomebetterconditionedandthusless TheimprovementliesintherepresentationofthetrajectoriesoftheDOFina θ 1 θ 2 Ball θ 3 z θ2 θ1 φ x Ball θ3
CHAPTER5.HIERARCHICALSPACETIMECONTROL 105 Figure36:Scenefromabasketballgame.
CHAPTER5.HIERARCHICALSPACETIMECONTROL 106 (1) (2) (3) (4) (5) (6) (7) (8) (9) Figure37:Thetwobasketballplayers (10) (11) (12) (13) (14) (15)
Chapter6 ConclusionsandFutureResearch basedanimationsystemstobecomeusefulinpractice. Despitecontinuedresearchonphysicallybasedanimationapproaches,keyframing systemsarestillthepredominanttoolforanimation.thisisduetothecontrolprovidedtotheanimatorandthefastcomputationofinbetweenframes.howtoprovide 6.1Contributions Thisthesishaspresentedtheprogresswehavemadeinthisdirection.Inparticular, controloveradynamicsystemwhileachievingeciencyisessentialforphysically wemadeimprovementstothespacetimeconstraintsystembothsymbolicallyand optimizationsystem.thenotionofallowingtheusertospecifykeyframeswhile andgeneralinterfacewithfastdynamicsandgradientcomputations.thissymbolic methodmakesitpossibletoapplyspacetimeconstraintmethodstocomplexgures. ThekeyframeoptimizationsystemasdescribedinChapter4integratesdynamics intoakeyframesystemtoachievegoodusercontrolwhiletakingadvantageofthe numerically.thesymbolicmethodasdescribedinchapter3providesaconvenient moregeneralspacetimeconstraintsystem.thehierarchicalrenementschemewith lettingthecomputerdecidespeedandtimingisvaluable,andthemethodhasbeen showntobeabletoanimatecomplexhumanguresatnearlyinteractivecomputation speeds.thehierarchicalspacetimeconstraintmethodwithitswaveletrepresentation ofthedoffunctionshasbeenshowntosignicantlyspeedupcomputationsinthe 107
CHAPTER6.CONCLUSIONSANDFUTURERESEARCH localdetailsaddedlayerbylayerwherevernecessaryisshowntobeeectivefor generatinghighqualitygoaldirectedmotionoflinkedgures. 108 Onelimitationwithoursystemisthatitisdiculttodealwithcontactsandcollisions duetotheresultingdiscontinuitiesinthetrajectories.contactsandcollisionsare 6.2FutureWork ular,weneedtoprovidemoregraphicallybasedand/orintuitivemeanstogenerate, force.howtoincorporatecontactsandcollisionsintoatrajectorybasedsystemis stillanopenproblem. importantbehaviors,forexample,whenasoccerplayerkicksaball,thereisan impactforceonhim(her)whichresultsinextramotionstorespondtotheimpact describedinchapter3,sothatthesystemiseasiertouseandmoreproductive. modifyandinspecttheexpressionsofconstraintsandobjectiveinthelanguageas Anotherpracticalissuethatneedstobeaddressedistheuserinterface.Inpartic- Ideally,wecouldsomehowmodifytheprevioussolutionwithouthavingtorunthe more,butifthechangeofthebasketpositionisnottoolarge,anaccuratethrow optimizationprocessalloveragain.forexample,considerthebasketballplayer.if wechangethepositionofthebasket,thenthesamethrowwon'tmakethegoalany onemotion.ifwechangetheenvironmentorthegure,thesolutionhastochange. Reusabilityisanotherinterestingproblem.Eachtrajectorycorrespondstojust avoidruningtheoptimizationprocess?onepossibleapproachwouldbetomodifythe trajectoryoftheendpoint(thehand)insuchawaythatthedierenceisminimum (basedonsomesortofmeasurement)andtheballgoesintothebasket.thenwemay tothenewbasketpositionmaybeverysimilarto,thoughnotexactlythesameas, ndthedoftrajectoriessimplyusinginversekinematics. solutiontosavethenumberofiterations.aninterestingquestionis:canwetotally thepreviousone.theprevioussolutioncanbeusedastheinitialguessforthenew provideonewayofgeneratingnewmotions. capture.howtogeneratenewmotionsfromtherecordedmotionisacentralproblem tomakemotioncapturemoreproductive.asolutiontoreusabilityproblemmay Asolutiontothereusabilityproblemwouldalsohaveapplicationsinmotion
CHAPTER6.CONCLUSIONSANDFUTURERESEARCH consideranarmthrowingaballintoabasket.inourexperimentssofar,thehand doesnothavengers.ifwewanttoconsiderallthengers,theresultingoptimization Taskhierarchyisanotherpossibledirectiontospeedupcomputations.Againlet's 109 basketballplayermovesignicantlyonlyatthemomentwhentheballleavesthe problemwouldbecomeextremelylarge.however,inreallife,thengersofareal handtoadjustthespeedoftheballsothatitcanmakethegoal.inorderwords,the shoulder,elbowandwristarecontrollingthemotioninalargescale,whilethengers aremakingneradjustments.thereforeitmaybereasonabletocomputetherough motionrstbyonlyconsideringthesignicantjoints(shoulder,elbowandwrist)and nothavingtorequiretheballmakethegoalexactly.theresultingmotion,though notanaccuratethrow,wouldroughlydeterminethestyleofthemotion.thenwe cancomputethetrajectoriesofthoseinsignicantjoints(ngers)sothatthethrow canlimitthetimeintervaltobeasmallneighborhoodofthethrowingmomentto isactuate.sincethengersmovesignicantlyonlyatthemomentofthrowing,we savecomputations.
Bibliography [1]AlfredV.Aho,RaviSethi,andJereyD.Ullman.Compilers:Priciples,TechniquesandTools.AddisonWesley,1986. [2]BillArmstrongandMarkGreen.Thedynamicsofarticulatedrigidbodiesfor [4]R.Bartels,J.Beatty,andB.Barsky.AnIntroductiontoSplinesforUsein [3]D.Bara.Analyticalmodelsfordynamicsimulationofnon-penetratingrigid bodies.acmcomputergraphics,23(3):223{232,july1989. ComputerGraphicsSociety,May1986. purposesofanimation.inproceedingsofgraphicsinterface,pages407{415. [5]RichardBartels,JohnBeatty,andBrianBarsky.AnIntroductiontoSplinesfor CA,1990. ComputerGraphicsandGeometricModeling.MorganKaufmann,LosAltos, [7]LynnShapiroBrotmanandArunN.Netravali.Motioninterpolationbyoptimal [6]RonenBarzelandAlanH.Barr.Amodelingsystembasedondynamicconstraints.InProceedingsofSIGGRAPH'88(Atlanta,Georgia,August1{5,1988), pages179{188.acm,august1988. UseinComputerGraphicsandModeling.MorganKaufmann,1987. [8]A.BruderlinandT.Calvert.Goal-directed,dynamicanimationofhumanwalking.ACMComputerGraphics,23(3):233{422,July1989. volume22,pages309{315.acm,august1988. control.inproceedingsofsiggraph'88(atlanta,georgia,august1{5,1988), 110
BIBLIOGRAPHY [10]JimX.Chen,NielsdaVitoriaLobo,CharlesE.Hughes,andI.MichaelMoshell. [9]E.Catmull.Theproblemsofcomputer-assistedanimation.InSIGGRAPH, pages348{353,1978. 111 [11]CharlesChuiandEwaldQuak.Waveletsonaboundedinterval.Numerical ofiowa,july13-151995. MethodsofApproximationTheory,9:53{75,1992. SimulationandInteractioninVirtualEnviroments,pages159{167,University Simulationandsynchronizationofuidsinadis.InTheFirstWorkshopon [12]CharlesK.Chui.AnIntroductiontoWavelets,volume1ofWaveletAnalysis [14]JohnJ.Craig.IntroductiontoRobotics.Addison-Wesley,Reading,MA,1986. [13]MichaelF.Cohen.Interactivespacetimecontrolforanimation.ComputerGraphics,26(2):293{302,July1992. anditsapplications.academicpressinc.,1992. [17]GarciadeJalonJavier.Kinematicanddynamicsimulationofmultibodysystems: [16]I.Daubechies.TenLecturesonWavelets.CBMS-NSFSeriesinAppl.Math., [15]WolfgangDahmenandAngelKunoth.Multilevelpreconditioning.Numerische SIAMpublications,Philadelphia.,1992. thereal-timechallenge.newyork:springer-verlag,1994. Mathematik,63:315{344,1992. [18]L.C.W.DixonandG.P.Szego.TowardsGlobalOptimization.North-Holland, [19]D.N.BurghesandA.M.Downs.ModernIntroductiontoClassicalMechanicsand Amsterdam,1975. [21]R.Fletcher.PracticalMethodsofOptimization,Vol.1and2.JohnWileyand [20]RoyFeatherstone.Robotdynamicsalgorithms.Boston:Kluwer,1987. Control.EllisHorwood,1975. Sons,1980.
BIBLIOGRAPHY [22]JamesD.Foley,AndriesvanDam,StevenK.Feiner,andJohnF.Hughes. ComputerGraphics:PrinciplesandPractice.AddisonWesley,Reading,Massachusetts,2edition,1990. 112 [23]DavidForseyandRichardBartels.Hierarchicalb-splinerenement.Computer [24]MichaelGirardandA.A.Macielewski.Computationalmodelingforthecomputer [25]StevenGortlerandMichaelF.Cohen.Variationalmodelingwithwavelets.Tech- Graphics,22(4):205{212,August1988. animationofleggedgures.inproceedingsofsiggraph'85(sanfrancisco, [26]StevenGortler,PeterSchroder,MichaelCohen,andPatHanrahan.Wavelet nicalreportcs-tr-456-94,departmentofcomputerscience,princetonuni- versity,1994. radiosity.incomputergraphics,annualconferenceseries,1993,pages221{ California,July22{26,1985).ACM,July1985. [28]JessicaK.Hodgins,WayneL.Wooten,DavidC.Brogan,andJamesF.O'Brien. [27]JamesHahn.Realisticanimationofrigidbodies.InProceedingsofSIG- 1988. GRAPH'88(Atlanta,Georgia,August1{5,1988),pages299{308.ACM,August 230.Siggraph,August1993. [29]JohnM.Hollerbach.Arecursivelagrangianformulationofmanipulatordynamics Animatinghumanathletics.InProceedingsofSiggraph,LosAngeles,CA,August [30]PaulM.IsaacsandMichaelF.Cohen.Controllingdynamicsimulationwithkinematicconstraints,behaviorfunctions,andinversedynamics.InProceedingsof 6-111995. andacomparativestudyofdynamicsformulationcomplexity.ieeetransactions July1987. onsystems,man,andcybernetics,10(11):730{736,november1980. SIGGRAPH'87(Anaheim,California,July27{31,1987),pages215{224.ACM,
BIBLIOGRAPHY [32]ThomasR.Kane.Dynamics.StanfordUniversity,1972. [31]PaulM.IsaacsandMichaelF.Cohen.Mixedmethodsforkinematicconstraints indynamicgureanimation.thevisualcomputer,4,1988. 113 [33]MichaelKass.Condor:Constraint-baseddataow.InProceedingsofSIG- [35]JohnLasseter.Principlesoftraditionalanimationappliedto3dcomputeranimation.InSIGGRAPH,pages35{44,1987. motionofarticulatedstructures.ieeecomputergraphicsandapplications, [34]JamesU.KoreinandNormanI.Badler.Techniquesforgeneratinggoal-directed 2(6):71{81,November1982. GRAPH'92(Chicago,July26{31,1992),pages321{330.ACM,July1992. [36]PhilipLee,SusannaWei,JianminZhao,andNormanI.Badler.Strengthguided [37]ZichengLiuandMichaelF.Cohen.Decompositionoflinkedguremotion:Diving.InProceedingsof5thEuroGraphicsWorkshoponAnimationandSimulation, basedanimationsystems.inproceedingsof6theurographicsworkshopon (Oslo,Norway,September2-31994). motion.inproceedingsofsiggraph'90(dallas,texas,august6{10,1990), [38]ZichengLiuandMichaelF.Cohen.Anecientsymbolicinterfacetoconstraint pages253{262.acm,august1990. [39]ZichengLiuandMichaelF.Cohen.Keyframemotionopimizationbyrelaxing AnimationandSimulation,(Maastricht,TheNetherlands,September2-31995). Springer-Verlag. [40]ZichengLiu,StevenGortler,andMichaelF.Cohen.Hierarchicalspacetime speedandtiming.inproceedingsof6theurographicsworkshoponanimation Verlag. andsimulation,(maastricht,thenetherlands,september2-31995).springer- control.computergraphics,pages35{42,july1994.
BIBLIOGRAPHY [41]GavinS.P.Miller.Themotiondynamicsofsnakesandworms.InProceedings ofsiggraph'88(atlanta,georgia,august1{5,1988),pages169{173.acm, August1988. 114 [43]J.ThomasNgoandJoeMarks.Spacetimeconstraintsrevisited.InComputer [42]BrianMirtichandJohnCanny.Impulse-basedsimulationofrigidbodies.In [44]AlexPentlandandJohnWilliams.Goodvibrations:Modaldynamicsforgraphicsandanimation.InProceedingsofSIGGRAPH'89(Boston,Mass.,July31{ Aug4,1989),pages215{222.ACM,July1989. Graphics,AnnualConferenceSeries,1993,pages343{350.Siggraph,August SymposiumonInteractive3DGraphics,1995. [45]CaryB.Phillips,JianminZhao,andNormanI.Badler.Interactivereal-time 1993. [46]GaryB.PhillipsandNormanI.Badler.Interactivebehaviorsforbipedalarticulatedgures.ComputerGraphics,25(4):359{362,July1991ingsofSymposiumonInteractive3DGraphics(Snowbird,Utah,March,1990), volume24,pages245{250.acm,march1990. articulatedguremanipulationusingmultiplekinematicconstraints.inproceed- [47]W.H.PressandB.Flannery.NumericalRecipes:TheArtofScienticComputing.CambridgeUniversityPress,1986. [48]W.H.Press,B.P.Flannery,S.A.Teukolsky,andW.T.Vetterling.Numerical [50]EwaldQuakandNormanWeyrich.Decompositionandreconstructionalgorithms [49]WillaimPress,S.Teukolski,WVetterling,andBFlannery.NumericalRecipies 1992. Recipies.CambridgeUniversityPress,1986. forsplinewaveletsonaboundedinterval.technicalreport294,centerfor ApproximationTheory,TexasA&M,1993. inc,theartofscienticcomputing.cambridgeuniversitypress,2edition,
BIBLIOGRAPHY [51]MarcH.RaibertandJessicaK.Hodgins.Animationofdynamicleggedlocomotion.siggraph91,4(25):349{358,1991. 115 [52]S.M.RobertsandJ.S.Shipman.Two-PointValueProblems:ShootingMethods. [53]DemetriTerzopoulos.Imageanalysisusingmultigridrelaxationmethods.IEEE [54]MichielvandePanneandEugeneFiume.Sensor-actuatornetworks.InComputer AmericanElsevier,1972. [55]JaneWilhelms.Usingdynamicanalysisforrealisticanimationofarticulated PAMI,8(2):129{139,March1986. [56]AndrewWitkinandMichaelKass.Spacetimeconstraints.ComputerGraphics, Graphics,AnnualConferenceSeries,1993,pages335{342.Siggraph,August 1993. [57]JianminZhaoandNormanI.Badler.Realtimeinversekinematicswithjoint bodies.ieeecomputergraphicsandapplications,7(6):12{27,june1987. 22(4):159{168,August1988. ComputerandInformationScience,UniversityofPennsylvania,1989. limitsandspatialconstraints.technicalreportms-cis-89-09,departmentof