Jump to content
  • Advertisement
Sign in to follow this  
Hatori

Animation blending

This topic is 4055 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

Ok I have written an animation system that I am trying to add blending support to. For example a character is running and then blends into a walk animation. Now let's say I am blending 3 animations together. So each animation I have the keyframe that is generated and is correct as well as the blend weight for the animations. My question is how do I blend all the 3 animations together? I do normalize the blend weights if the sum of the 3 animation blend weights is greater than one, but how do I combine the keyframes for the 3 animations together? I am very confused as to how to go about it so I would greatly appreciate any help anyone can give me. Many thanks for anyones help.

Share this post


Link to post
Share on other sites
Advertisement
I think it would be the same as interpolating two frames of the same animation.

Interpolating between the frames of animation 1 and 2 and then interpolate the result with animation 3.

Share this post


Link to post
Share on other sites
The translation component of the animation is usually blended simply with a weighted sum, so if your weights are (w0, w1, w2) and your translation vectors (v0, v1, v2) then the blended vector is w0*v0 + w1*v1 + w2*v2.

Rotations are more complicated. There are 3 desirable features for rotation interpolation (commutativity, constant velocity and minimal torque) but unfortunately you can't get all 3 at once. Typically in games, you will use a normalized lerp as it is the most efficient, and sacrificing constant velocity is not such a big deal in practice. A normalized lerp is exactly the same as above followed by normalizing the resulting quaterion, but you will need to check for singularities (ie the result quaternion being 0 length).

A couple of good articles to read are this and this.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!