/
Harmonic Coordinates Tony DeRose Mark Meyer Pixar Technical Memo  Pixar Animation Studios Harmonic Coordinates Tony DeRose Mark Meyer Pixar Technical Memo  Pixar Animation Studios

Harmonic Coordinates Tony DeRose Mark Meyer Pixar Technical Memo Pixar Animation Studios - PDF document

tatyana-admore
tatyana-admore . @tatyana-admore
Follow
589 views
Uploaded On 2014-12-13

Harmonic Coordinates Tony DeRose Mark Meyer Pixar Technical Memo Pixar Animation Studios - PPT Presentation

a The character and cage at bindtime b d the deformed character corresponding to three different poses of the cage Abstract Generalizations of barycentric coordinates in two and higher di mensions have been shown to have a number of applications in ID: 23318

The character and

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Harmonic Coordinates Tony DeRose Mark Me..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

(a)(d) (b)(e) (c)(f)Figure2:Twodimensionalgeneralizedbarycentriccoordinatesusedtodenedeformationsoftwodifferentobjects(showninblue)usingcages(showninblack).Thetoprowshowsthecagesandob-jectsat”bind”time.Thesecondrowshowsmodiedcagesandthecorrespondingdeformedobjectsusingmeanvaluecoordinates.Thelastrowshowsmodiedcagesanddeformedobjectsusinghar-moniccoordinates.Inthelasttworows,theoriginalundeformedobjectisshowninwhite.Thetwomethodsperformsimilarlyforconvexshapes.Inthebipedalcase,harmoniccoordinatesperformbetterinthatthemotionofcagepointsintheleftlegdoesnotinu-encepointsintherightleg.beretainedinthegeneralization,therichnessresultsfromthemanydifferentwaysthepropertiescanberelaxed.Weareparticularlyinterestedinusinggeneralizedbarycentricco-ordinatesforcharacterdeformation,asshowninFigure1andasdescribedinJuet.al[Juetal.2005].Inthisapplication,anobjecttobedeformedispositionedrelativetoaclosedshapethatwe'llcallacage.ExamplesareshowninFigures1andFigure2.Theobjectisthen“bound”tothecagebycomputinggeneralizedbarycentriccoordinatesgi(p)ofeachobjectpointprelativetothecagever-ticesCi.AsthecageverticesaremovedtonewlocationsC0i,thedeformedpointsp0arecomputedfromp0=åigi(p)C0i(5)Ofthevariousgeneralizedbarycentriccoordinateformulationsavailable,meanvaluecoordinates[Floater2003;Floateretal.2005;Juetal.2005]areparticularlyusefulinthisapplicationbecause:Thecagethatcontrolsthedeformationcanbeanysimpleclosedpolygonintwodimensions,andanysimpleclosedtri-angularmeshinthreedimensions.Thecoordinatesaresmooth,sothedeformationissmooth.Thecoordinatesreproducelinearfunctions,sotheobjectdoesn't“pop”whenitisbound.Thatis,thecoordinatesaresuchthatsettingC0itoCiinEquation5resultsinp0reducingtop.Asecondexamplemotivatedbythearticulationofbipedalcharac-tersisshowninthesecondcolumnofFigure2.NoticehowthemodiedcagepointsonthelegontheleftinFigure2(e)inuencethepositionofobjectpointsinthelegontheright.ThisoccursbecausemeanvaluecoordinatesarebasedonEuclidean(straight-line)distancesbetweenpointsofthecageandpointsoftheobject.Althoughtheinuenceisnoticeableinstillimages,themovementofpointsintherightlegwhentheleftlegcagepointsisparticularlystrikingininteractiveuse,asdemonstratedintheaccompanyingvideo.Thebehaviorof3Dmeanvaluecoordinatesissimilar,andishighlyundesirableforthearticulationofcharactersinfeaturelmproduction.Whatisneededforcharacterarticulationisaformofgeneralizedbarycentriccoordinatesthataddsthefollowingpropertiestothoseenjoyedbymeanvaluecoordinates:Non-negativity.Thisimpliesthatobjectpointsmoveinthesamedirectionascagepoints;negativecoordinatesmeantheycanmoveintheoppositedirection.NegativityofmeanvaluecoordinatesisresponsiblefortherightlegpointsinFig-ure2(e)movingintheoppositedirectionfromtheleftlegcagepoints.NegativityisalsoresponsibleforthecollapsingoftheleftlegpointsinFigure2(e).Interiorlocality.Informally,thecoordinatesshouldfalloffasafunctionofthedistancebetweencagepointsandobjectpointsasmeasuredwithinthecage.Inthispaperweshowthatsuchcoordinatescanbeproducedasso-lutionstoLaplace'sequationwithappropriatelychosenboundaryconditions.SincesolutionstoLaplace'sequationaregenericallyreferredtoasharmonicfunctions,wethereforecallthesecoordi-natesharmoniccoordinates,andthedeformationstheygenerateharmonicdeformations.11.1PreviousworkLaplace'sequation,harmonicfunctions,andharmonicmapshaveoftenbeenmentionedinpreviousconstructionsofbarycentriccoor-dinatesintwodimensions.Forinstance,the“cotangentweights”of[PinkhallandPolthier1993]and[Meyeretal.2002]canbederivedfrompiecewiselineardiscretizationsofLaplace'sequation.Sim-ilarly,Floater'sconstructionofmeanvaluecoordinateswasmo-tivatedbythemeanvaluetheoremforharmonicfunctions.ItissomewhatsurprisingtousthatdirectsolutionofLaplace'sequationhasneverbeenusedtocreategeneralizedbarycentriccoordinates,butthatseemstobethecase.AnotherconnectionbetweenLaplace'sequationandmeanvaluecoordinatescomesfromthemotivationgivenin[Juetal.2005].Theyderivemeanvaluecoordinatesstartingwithaninterpolanttheycallthemeanvalueinterpolant.Themeanvalueinterpolanttoafunctionfdenedonaclosedboundaryworksasfollows.To 1Sinceeachcomponentofaharmonicdeformationisaharmonicfunc-tion,manytextsrefertosuchdeformationsasharmonicmaps.Wepreferthetermharmonicdeformationbecauseofthecontextinwhichthey'reusedinthispaper. Figure3:Meanvaluevsharmonicinterpolation.(a)Thestraight-linepathscorrespondingtomeanvalueinterpolation.(b)TheBrownianpathscorrespondingtoharmonicinterpolation.computeavalueforeachinteriorpointp,considereachpointxontheboundary.Multiplyf(x)bythereciprocaldistancefromxtop,thenaverageoverallx(seeFigure3(a)).Thisdenitionmakesitclearthatmeanvaluecoordinatesinvolvestraight-linedistancesirrespectiveofthevisibilityofxfromp.Analternativeinterpolantthatrespectsvisibilityistoaveragenotoverallstraight-linepaths,butrathertoaverageoverallBrownianpathsleavingp,wherethevalueassignedtoeachpathisthevalueoffatthepointthepathrsthitstheboundary(seeFigure3(b)).Althoughthisdenitionatrstseemsintractabletocompute,itisafamousresultfromstochasticprocesses(c.f.[PortandStone1978],[Bass1995])thattheinter-polantthusproduced(inanydimension)infactsatisesLaplace'sequationsubjecttotheboundaryconditionsgivenbyf.22TheoryInthissectionweformalizethediscussionofSection1.LetCbeaclosed(notnecessarilyconvex)volumeinddimensionswithapiecewiselinearboundary.Geometerscallsuchshapespolytopes,butbecausewehavespecicusesinmind,werefertotheseshapesinsteadascages.Intwodimensions,acageisaregionoftheplaneboundedbyaclosedpolygon(suchastheoneshowninFigure2),andinthreedimensionsacageisaclosedregionofspaceboundedbyplanar(thoughnotnecessarilytriangular)faces.ForeachoftheverticesCiofthecage,weseekafunctionhi(p)denedonCsubjecttothefollowingconditions:1.Interpolation:hi(Cj)=di;j.2.Afne-invariance:åihi(p)=1forallp2C.3.Strictgeneralizationofbarycentriccoordinates:whenCisasimplex,hi(p)isthebarycentriccoordinateofpwithrespecttoCi.4.Smoothness:Thefunctionshi(p)areatleastC1smooth.5.Non-negativity:hi(p)0,forallp2C.6.Linearreproduction:Givenanarbitraryfunctionf(p),thecoordinatefunctionscanbeusedtodeneaninterpolantH[f](p)accordingto:H[f](p)=åihi(p)f(Ci)(6)FollowingJuet.al[Juetal.2005],werequireH[f](p)tobeexactforlinearfunctions.AsshownbyJuet.al,takingf(p)=pmeansthatp=åihi(p)Ci(7)whichisthe“non-popping”conditionmentionedinSection1. 2Wethank[nameomittedforreviewpurposes]forpointingoutthiscon-nectiontous.7.Interiorlocality:Wequantifythenotionofinteriorlocalityintroducedaboveasfollows:interiorlocalityholds,if,inad-ditiontonon-negativity,thecoordinatefunctionshavenoin-teriorextrema.Meanvaluecoordinatespossessallbuttwooftheseproperties:namely,non-negativityandinteriorlocality.Weclaimthatcoor-dinatefunctionssatisfyingallsevenpropertiescanbeobtainedassolutionstoLaplace'sequation52hi(p)=0;p2Int(C)(8)iftheboundaryconditionsarecarefullychosen.Togainsomeinsightintohowtheboundaryconditionsaredeter-mined,weconsiderrsttheconstructionofharmoniccoordinatesintwodimensions.Itwillthenbeclearhowtheconstructiongener-alizestoddimensions.Forreasonsthatwillsoonbecomeapparent,theappropriateboundaryconditionsforhi(p)intwodimensionsareasfollows.Let¶pdenoteapointontheboundary¶CofC,thenhi(¶p)=fi(¶p);forall¶p2¶C(9)wherefi(¶p)isthe(univariate)piecewiselinearfunctionsuchthatfi(Cj)=di;j.Forexample,ifCisthecageshowninFigure4(a),thenfi(¶p)isthepiecewiselinearfunctiondenedontheedgese1;:::;e15suchthatfi(Cj)=di;j,fori;j=1;:::;15.WenowshowthatfunctionssatisfyingEquation8subjecttoEqua-tion9possessthepropertiesenumeratedabove.Itturnsoutthatthelinearreproductionpropertysubsumesseveralotherconditions,soforpurposesofproofweverifytheconditionsinadifferentorderthantheonepresentedabove.Interpolation:byconstructionhi(Cj)=fi(Cj)=di;j.Smoothness:AwayfromtheboundaryharmoniccoordinatesaresolutionstoLaplace'sequation,andhencetheyareC¥.Non-negativity:harmonicfunctionsachievetheirextremaattheirboundaries.Sinceboundaryvaluesarerestrictedto[0;1],interiorvaluesarealsorestrictedto[0;1].Linearreproduction:Letf(p)beanarbitrarylinearfunc-tion.WeneedtoshowthatH[f](p)=f(p),whereH[f](p)isdenedasinEquation6.WebeginbyestablishingthatH[f](p)=f(p)everywhereontheboundaryofC.If¶pisapointontheboundaryofC,thenbyconstructionH[f](¶p)=åihi(¶p)f(Ci)=åifi(¶p)f(Ci)(10)Thefunctionsfi(¶p)aretheunivariatelinearB-splineba-sisfunctions(commonlyknownasthe“hatfunction”basis),whicharecapableofreproducingalllinearfunctionson¶C(infact,theyreproduceallpiecewiselinearfunctionson¶C).NextweextendtheresulttotheinteriorofC.Notethatsincef(p)islinear,allsecondderivativesvanish,andinparticular52f(p)=0;thusf(p)satisesLaplace'sequationontheinteriorofC.H[f](p)alsosatisesLaplace'sequationontheinterior,becauseforinteriorpointsp:52H[f](p)=52åihi(p)f(Ci)=åif(Ci)52hi(p)=åif(Ci)0=0Sincef(p)andH[f](p)agreeontheirboundariesandarebothsolutionstothesamedifferentialequation,byunique-nessofsolutionstoPDEs,theymustbethesamefunction. (a)(b)(c)Figure4:Acomparisonofcoordinatefunctionsforaconcavecage.(a)A2DcagewithverticesC1;:::;C15;(b)thevalueofthemeanvaluecoordinateforC2(yellowindicatespositivevalues,greenindicatesnegativevalues);(c)thevalueoftheharmoniccoordinateforC2(reddenotestheexteriorofthecagewherethefunctionisundened).Toaccentuatevaluesnearzero,intensitiesofyellowandgreenareproportionaltothesquarerootofthecoordinatefunctionvalue.ThesignicantinuenceofthepositionofC2onobjectpointsinthelegontherightisindicatedbythepresenceofgreenintherightlegof(b).Thecorrespondinginuencein(c)isessentiallyzero.Afneinvariance:Thefunctionf(p)=1islinear,soafneinvariancefollowsimmediatelyfromthelinearreproductionproperty.Strictgeneralizationofbarycentriccoordinates.IfthecageCconsistsofasingletriangleharmoniccoordinatesreducetobarycentriccoordinates.Letbj(p)denotethebarycentriccoordinatesofpwithrespecttothetriangle.Toestablishthathj(p)=bj(p),notethatbj(p)isalinearfunction,sowecanusethelinearreproductionpropertyabovebytakingf(p)=bj(p):bj(p)=H[bj](p)=åihi(p)bj(Ci)=åihi(p)di;j=hj(p)Interiorlocality:followsfromnon-negativityandthefactthatharmonicfunctionspossessnointeriorextrema.Togeneralizefromtwotoddimensions,werstbackupandcon-siderharmoniccoordinatesinonedimension.InonedimensionacageisalinesegmentboundedbytwoverticesC0andC1,andLaplace'sequationreducestod2hi(p) dp2=0:(11)Thus,hi(p)isalinearfunction,andtheproper(zerodimen-sional)boundaryconditionscomefromtheinterpolationproperty:hi(Cj)=di;j.Withthisinsight,wecanreposethetwodimensionalconstructionas:toconstructtwodimensionalharmoniccoordinates,startwiththeinterpolationconditionshi(Cj)=di;j.Thisdeterminesthecoor-dinatesonthe0-dimensionalfacets(thevertices)ofC.Next,extendthecoordinatestothe1-dimensionalfacets(theedges)ofCusingtheonedimensionalversionofLaplace'sequation.Finally,extendthemtothetwodimensionalfacets(theinterior)ofCusingthetwodimensionalversionofLaplace'sequation.Theextensiontothreeandhigherdimensionsfollowsimmediately:Theharmoniccoordinateshi(p)foraddimensionalcageCwithverticesCi,aretheuniquefunctionssuchthat:1.hi(Cj)=di;j.2.Oneveryfacetofdimensionkd,thekdimensionalLaplaceequationissatised.Toprovethatddimensionalharmoniccoordinatesdenedinthiswaypossesstherequiredproperties,wecanuseinductiononthefacetdimension,startingwiththe1-facetsasthebasecase.Theproofsgivenabovefortwodimensionsareactuallymoregeneral;theyarevalidinanydimensionkassumingthatlinearreproductionisachievedonthek�1facets.Theseproofsthereforeserveastheinductivestep.Havingdenedcoordinatesinthisway,byconstructionwehavethefollowingadditionalpropertythatissharedbybarycentricco-ordinatesandWarren's[Warren1996]construction:Dimensionreduction:ddimensionalharmoniccoordinates,whenrestrictedtoakddimensionalfacet,reducetokdi-mensionalharmoniccoordinates.Forexample,athreedimensionalcageboundedbytriangularfacetspossessesharmoniccoordinatesthatreducetobarycentriccoordi-natesonthefaces.Similarly,adodecahedralcagewillhave3Dharmoniccoordinatesthatreduceto2Dharmoniccoordinatesonitspentagonalfaces.3ImplementationOurcurrentimplementationofharmoniccoordinatesislimitedtotwoandthreedimensions.Inbothcasesweuseasimplehierarchi-calnitedifferencesolver,thoughinprincipleanysolutionmethodforLaplace'sequation,suchasaniteelementmethod,couldbeused.Nowforsomedetails.Firstwe'lldescribethenon-hierarchialver-sionofthesolver.We'llthendescribetheextensiontothehierar-chicalsolver.ForeachvertexCiofthecage,weapproximatehi(p)overtheinteriorofthecageasfollows:1.Allocatearegulargridofcellsthatislargeenoughtoenclosethecage.Wechoosethegridtocontain2scellsonaside.Alltwodimensionalexampleshavebeencomputedwiths=6;threedimensionalexamplesuses=7.Eachgridcellcon-tainsavalue,andatag,wherethetagisoneofUNTYPED,BOUNDARY,INTERIOR,orEXTERIOR.2.Initializethegridby:(a)TagallcellsasUNTYPED. (b)Scan-convertboundaryconditionsintothegrid,mark-ingeachscanconvertedcellwiththeBOUNDARYtag.Intwodimensions,thefunctionfi(p)asdenedinSec-tion2isscan-convertedintothegrid.Inthreedimen-sionals,ourimplementationiscurrentlyrestrictedtotri-angularfaces,meaningthattheboundaryvaluesvary-inginapiecewiselinearfashion.Wethereforeuseasimplevoxel-basedtrianglescan-converterinthisstage.(c)Startingwithoneofthecornercells,oodlltheexte-rior,markingeachvisitedcellwiththeEXTERIORtag.TheoodllrecursionstopswhenBOUNARYtagsarereached.Sincetheboundaryisclosed,onlytheexteriorcellsarevisitedduringthisstage.(d)MarkremainingUNTYPEDcellsasINTERIORwithharmoniccoordinatevalueequalto0.3.Laplaciansmooth:ForeachINTERIORcell,replacethevalueofthecellwiththeaverageofthevalueofitsneigh-bors.In2Dcellsareconsideredtobe4-connected;in3Dtheyareconsideredtobe6-connected.ThisLaplaciansmoothingstepisperformediterativelyuntiltheterminationcriterionisreached.Oursolverterminateswhentheaveragechangetoacelldropsbelowaspeciedthresholdt.Allexamplesinthispaperhaveusedt=10�5.Thesolverdescribedabovecanbesignicantlyacceleratedbynot-ingthatLaplace'sequationproducesverysmoothlyvaryingfunc-tions.Byrstsolvingtheproblematalowerresolution,betterstart-ingpointsfortheiterationcanbeobtained.Thehierarchicalsolverexploitsthisobservationby“pulling”theboundaryconditionsuptoacoarserlevel,recursivelysolvingthere,“pushing”thecoarsesolu-tiondowntothenerlevel,theniteratingtheLaplaciansmoothingstepuntilconvergenceisreached.Thepullingstepintwodimensionscomputesacoarselevelgridofsize2s�12s�1fromanelevelgridofsize2s2s.Eachcoarselevelgridcellrepresentsfour“children”cellsonthenerlevel.Inthreedimensions,eachcoarselevelgridcellrepresentseightchil-drencellsonthenerlevel.Inbothcases,acoarsecellistaggedasaBOUNDARYifatleastonechildistaggedasaBOUNDARY;itistaggedasEXTERIORifallchildrenareEXTERIOR,anditistaggedasINTERIORifallchildrenareINTERIOR.ThevalueofacoarselevelBOUNDARYcellistheaverageofthenerlevelBOUNDARYcells.INTERIORcellsonthecoarselevelareinitial-izedwithavalueofzero.ThepushingsteppropagatesvaluesfromcoarselevelcellstoIN-TERIORcellsonthenerlevel.Specically,allINTERIORcellsonthenerlevelreceivethevalueoftheirparentcellonthecoarselevel.4ResultsThebehaviorofharmonicdeformationsintwodimensionsisillus-tratedintheaccompanyingvideoaswellasinFigure2.Thebe-haviorofthreedimensionalharmonicdeformationsisillustratedinFigure1,wherewehaveboundanobjectcontaining8019verticestoacagecontaining112vertices.Thebindingtimeforthisex-amplewas262seconds,usingthehierarchicalsolverwithanestgridwith27cellsonaside,andacoarsestgridwith24cellsonaside.Theterminationtolerancetwas10�5.Thecorrespondingbindtimeformeanvaluecoordinateswas443secondsusingthealgorithmaspublishedinFigure4of[Juetal.2005].Noticethatthebindtimeforharmoniccoordinatesisfasterthanthatformeanvaluecoordinatesinthiscase.Theprimaryreasonisthattheharmoniccoordinatesolvercomputesanentirecoordinate Subdivisions Objectvertices MVC(insec) HC(insec) 0 21 0.16 29 2 242 1.7 30 4 3842 24 30 5 15,362 113 30 Table1:Acomparisonofthebindingtimeofthemeanvalueandharmoniccoordinatesolversasthenumberofobjectpointsin-creases.Theseexamplesweregeneratedbyusinganicosahedronasthecage,andasubdivideddodecahedronastheobject.The“Sub-divisions”columnindicatesthenumberoftimesthedodecahedronwassubdivided.Notethatthetimerequiredforharmoniccoordi-natesisrelativelyinsensitivetothenumberofobjectvertices.functionatatime.Onceacoordinatefunctioniscomputeditisveryinexpensivetolookupthevalueforeachoftheobjectpoints.Therunningtimeoftheharmonicsolveristhereforemoststronglydependentonthenumberofcagevertices.Themeanvaluesolver,ontheotherhand,iteratesovertheentirecageforeachoftheobjectpoints.Whenthenumberofobjectpointsissmallcomparedtothenumberofcagepoints,themeanvaluesolverisfaster.Asthenumberofobjectpointsincreases,theharmonicsolvereventuallyoutperformsthemeanvaluesolver.ThistrendisdemonstratedinTable1.Onepotentialdisadvantageofharmoniccoordinatescomparedtomeanvaluecoordinatesismemoryoverhead.Astraightforwardimplementationofmeanvaluecoordinatesrequiresonlyaconstantamountofadditionalmemoryforeachfaceofthecage,whereasthememoryrequirementsofoursimpleharmonicsolverisdominatedbythesolvergrid.Intwodimensionsthegridsaretypicallysmall(roughly40Kbytesinourexamples),butinthreedimensionsthegridscanbecomeratherlarge(roughly25Mbytesinourexamples).Harmoniccoordinatescomputedasaboveareonlynumericalap-proximations,wherethecellsizeandterminationthresholddeter-minetheaccuracy.Theapproximationerrorwill,ingeneral,causeeachobjectpointptoexperiencearesidualD(p)whenitisboundtothecage:D(p)=p�åihi(p)Ci(12)Anothersourceoferroroccurswhencoordinatesbelowathresholdareremovedfromthesum,aprocesswecallsparsication.Residu-alsduetosparsicationoccurforbothmeanvaluecoordinatesandharmoniccoordinates.Incaseswheretheresidualsaretoolarge,eitherbecauseofaninaccuratesolveorbecauseofoverlyagressivesparisication,theresidualscanbecomputedandstoredatbindtimeonaperobjectpointbasis.Theycanthenbeaddedbackatdeformationtimetoimprovetheaccuracyofthedeformationwithlittlerun-timeoverhead.Theexamplesusedinthispaperandtheaccompanyingvideowereaccurateenoughthatresidualswerenotused.4.1ExtensiontocellcomplexesHarmoniccoordinatesasformulatedthusfararedenedrelativetoacageconsistingofapolytope,meaningthedeformationiscon-trolledentirelybyboundaryverticesofthecage.Oncethebehavioroftheboundaryisset,thebehaviorontheentireinterioriscom-pletelydetermined.Inmanyinstancesthisisideal.However,itissometimeshelpfultogiveartistsadditionalcontroloverinteriordetailsofthedeformation.AsimpleexampleisshowninFigure5whereanadditionalisolatedvertexhasbeenaddedtorenecontrolofthedeformationintheareaoftheheadofthecharacter.Itisalsopossibletoextendthecagetoincludeinteriorfacesandedges;anexampleofincludingacollectionofinterioredgesis