Jump to content
  • Advertisement
Sign in to follow this  
ph33r

Animation blending: how to?

This topic is 4871 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been writing my own animation blending routine that cleary doesn't work at all. I'm not sure whats wrong so I'll post my algorithm and my data structure Bone Hierarchy - Original Transform - Contains a weighted transform - Final Transform. Algorithm: 1) Reset bone hierarchy to their original transformation. 2) Clear the weigted transform to zero matrix. 3) For each active animation ---- Calculate the interpolated bone for the keyframe ---- weightedTransform += interpolatedTransform * blendScalar; 4) Loop through each animation and all its bones ---- FinalTransform += weightedTransform

Share this post


Link to post
Share on other sites
Advertisement
To blend two animations together, am I right to say that the algorithm is

FinalTransform = BoneAnim1 * weight1 + BoneAnim2 * weight;

??

Share this post


Link to post
Share on other sites
I'm not sure about this, but I think the formula is not correct. In the simplest case, you need to do a linear interpolation between two animation steps, this could be done with:

argument1 * fInterpolation + (1-argument2) * fInterpolation

fInterpolation is a value between 0..1, which is used to decide how much to blend.

Brisco

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!