## RE: [Algorithms] calculating weights for blending arbitrary number of animations

 RE: [Algorithms] calculating weights for blending arbitrary number of animations From: Jon Watte - 2004-11-30 22:04:42 ```> Question is: Given N (in this paricular case 9) vectors and the aiming one > how to compute good weights that max to 1.0 when the aming coincides with > them? (Did I mention that weights need to add up to 1.0? but of course you > know that...) Here's one way: Project these vectors to points on the front plane, a unit distance away from the character. Perform a Delaunay triangulation on these points. Find the triangle which your desired aim vector lies within. Use barycentric coordinates for the three triangle vertex points, which map to the three vectors and weights you want to use. Note that almost all of this can be pre-calculated, and if the animations are constrained on a grid, the "find a triangle" is almost trivial, and the explicit triangulation doesn't have to be calculated. Cheers, / h+ ```

 [Algorithms] calculating weights for blending arbitrary number of animations From: Yordan Gyurchev - 2004-11-30 19:24:38 ```Hello, Imagine a soldier (or character with a weapon of some kind). We are tying to get its weapon (two weapons, two handed weapon) to point into the direction of aiming. We have 9 animations. Each represents a pose into a certain direction. Each "pose" animation has a vector associated with it. For a given character aiming direction vector we compute weight for each animation to contribute into the final anim. Question is: Given N (in this paricular case 9) vectors and the aiming one how to compute good weights that max to 1.0 when the aming coincides with them? (Did I mention that weights need to add up to 1.0? but of course you know that...) We have tried few methods and we have a couple of working but far from ideal bodged solutions. I'm sure someone has solved this problem elegantly with some clever maths. A lot of games seem to do that kind of thing although in some cases IK can be applied. One solution that gives smooth results is just a dot product. Wi = Vi dot Va where Wi are normalized afterwards with Wi = Wi/sum(Wi) (Wi weight for each bone, Vi - Direction vectors for anims, Va - aim vector) Unfortunately, this only works perfectly if all direction vectors (Vi) are perpendicular to each other so when they max out no other anim contributes to the final. It still works in other cases but the results are not accurate enough for us. We have also explored few solutions where assumptions have been made that some vectors lie in a certain plane but I'm looking for a generic solution that will work in all cases. Thanks, Yordan ```
 Re: [Algorithms] calculating weights for blending arbitrary number of animations From: Alex Mohr - 2004-11-30 19:38:05 ```This from SIGGRAPH last year may be relevant. Check the video, and I believe the paper starting at section 4 would be most useful, but reading the whole thing is probably worthwhile. http://www.cs.wisc.edu/graphics/Gallery/Kovar/ParamMotion/ Alex >Hello, > >Imagine a soldier (or character with a weapon of some kind). We are tying >to get its weapon (two weapons, two handed weapon) to point into the >direction of aiming. > >We have 9 animations. Each represents a pose into a certain direction. Each >"pose" animation has a vector associated with it. >For a given character aiming direction vector we compute weight for each >animation to contribute into the final anim. > >Question is: Given N (in this paricular case 9) vectors and the aiming one >how to compute good weights that max to 1.0 when the aming coincides with >them? (Did I mention that weights need to add up to 1.0? but of course you >know that...) > >We have tried few methods and we have a couple of working but far from ideal >bodged solutions. I'm sure someone has solved this problem elegantly with >some clever maths. A lot of games seem to do that kind of thing although in >some cases IK can be applied. > >One solution that gives smooth results is just a dot product. > Wi = Vi dot Va where Wi are normalized afterwards with Wi = Wi/sum(Wi) (Wi >weight for each bone, Vi - Direction vectors for anims, Va - aim vector) >Unfortunately, this only works perfectly if all direction vectors (Vi) are >perpendicular to each other so when they max out no other anim contributes >to the final. It still works in other cases but the results are not accurate >enough for us. > >We have also explored few solutions where assumptions have been made that >some vectors lie in a certain plane but I'm looking for a generic solution >that will work in all cases. > >Thanks, >Yordan > > > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://productguide.itmanagersjournal.com/ >_______________________________________________ >GDAlgorithms-list mailing list >GDAlgorithms-list@... >https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >Archives: >http://sourceforge.net/mailarchive/forum.php?forum_id=6188 ```
 Re: [Algorithms] calculating weights for blending arbitrary number of animations From: Yordan Gyurchev - 2004-11-30 22:05:56 ```Thanks for the paper. It references another paper: Articulated Body Deformation from Range Scan Data http://grail.cs.washington.edu/projects/digital-human/pub/allen02articulated.html Anyway they both apply the following formula: Wi = 1/(D(p,pi) - 1/D(p,pk) where D is a distance function and p1... pk are the nearest pose parameters and p is the supplied new parameter. They also implied that Euclidian distance does the job. But I struggle to understand how this works when distance is 0 in either part of the binom... simply wont work. Its clear that I'm missing something. I also saw a reference to another method called cardinal radial basis functions and a reference to a paper that I'm not able to find/download on the web. SLOAN, P.-P., ROSE, C., AND COHEN, M. F. 2001. Shape by example. In Proceedings of 2001 Symposium on Interactive 3D Graphics. Does anyone have a link? -Yordan ----- Original Message ----- From: "Alex Mohr" To: Sent: Tuesday, November 30, 2004 7:38 PM Subject: Re: [Algorithms] calculating weights for blending arbitrary number of animations > This from SIGGRAPH last year may be relevant. Check the video, and I > believe the paper starting at section 4 would be most useful, but > reading the whole thing is probably worthwhile. > > http://www.cs.wisc.edu/graphics/Gallery/Kovar/ParamMotion/ > > Alex > > > >Hello, > > > >Imagine a soldier (or character with a weapon of some kind). We are tying > >to get its weapon (two weapons, two handed weapon) to point into the > >direction of aiming. > > > >We have 9 animations. Each represents a pose into a certain direction. Each > >"pose" animation has a vector associated with it. > >For a given character aiming direction vector we compute weight for each > >animation to contribute into the final anim. > > > >Question is: Given N (in this paricular case 9) vectors and the aiming one > >how to compute good weights that max to 1.0 when the aming coincides with > >them? (Did I mention that weights need to add up to 1.0? but of course you > >know that...) > > > >We have tried few methods and we have a couple of working but far from ideal > >bodged solutions. I'm sure someone has solved this problem elegantly with > >some clever maths. A lot of games seem to do that kind of thing although in > >some cases IK can be applied. > > > >One solution that gives smooth results is just a dot product. > > Wi = Vi dot Va where Wi are normalized afterwards with Wi = Wi/sum(Wi) (Wi > >weight for each bone, Vi - Direction vectors for anims, Va - aim vector) > >Unfortunately, this only works perfectly if all direction vectors (Vi) are > >perpendicular to each other so when they max out no other anim contributes > >to the final. It still works in other cases but the results are not accurate > >enough for us. > > > >We have also explored few solutions where assumptions have been made that > >some vectors lie in a certain plane but I'm looking for a generic solution > >that will work in all cases. > > > >Thanks, > >Yordan > > > > > > > > > >------------------------------------------------------- > >SF email is sponsored by - The IT Product Guide > >Read honest & candid reviews on hundreds of IT Products from real users. > >Discover which products truly live up to the hype. Start reading now. > >http://productguide.itmanagersjournal.com/ > >_______________________________________________ > >GDAlgorithms-list mailing list > >GDAlgorithms-list@... > >https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > >Archives: > >http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > > ```
 Re: [Algorithms] calculating weights for blending arbitrary number of animations From: Alex Mohr - 2004-11-30 23:00:35 ```>I also saw a reference to another method called cardinal radial basis >functions and a reference to a paper that I'm not able to find/download on >the web. SLOAN, P.-P., ROSE, C., AND COHEN, M. F. 2001. Shape by example. >In Proceedings >of 2001 Symposium on Interactive 3D Graphics. > >Does anyone have a link? If I type 'shape by example' into google and hit "I'm feeling lucky", I get the pdf. Does this not work for you? Alex ```
 RE: [Algorithms] calculating weights for blending arbitrary number of animations From: Jon Watte - 2004-11-30 22:04:42 ```> Question is: Given N (in this paricular case 9) vectors and the aiming one > how to compute good weights that max to 1.0 when the aming coincides with > them? (Did I mention that weights need to add up to 1.0? but of course you > know that...) Here's one way: Project these vectors to points on the front plane, a unit distance away from the character. Perform a Delaunay triangulation on these points. Find the triangle which your desired aim vector lies within. Use barycentric coordinates for the three triangle vertex points, which map to the three vectors and weights you want to use. Note that almost all of this can be pre-calculated, and if the animations are constrained on a grid, the "find a triangle" is almost trivial, and the explicit triangulation doesn't have to be calculated. Cheers, / h+ ```