# Animation blending

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

## 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 on other sites
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 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.

1. 1
2. 2
Rutin
30
3. 3
4. 4
5. 5
khawk
14

• 11
• 11
• 23
• 10
• 9
• ### Forum Statistics

• Total Topics
633647
• Total Posts
3013108
×