Sign in to follow this  
ehmdjii

animation blending in skeletal based models (md5)

Recommended Posts

hello, i have implemented character animation using a skeleton with bones and a mesh with vertices, which have weights according to the bones. i read all the values from MD5-formatted files. now what i want to do is, that if my character walks and suddenly stops, that there is a smooth transition from the walk-animation to the standing-animation. how can i implement such animation blending? should i just interpolate between the two skeletons?

Share this post


Link to post
Share on other sites
Interpolating between frames of an animation is definitely a good idea. When setting you idle animation or stop-running animation, you could set it so it doesn't take effect until the current frame of the current animation has played out.

By this I mean, if you are currently interpolating between frame 5 and frame 6 of the running animation, you could take frame 0 of the idle animation and only put it into place when frame 5 is no longer part of the equation. Then interpolate between frame 6 of running and frame 0 of idle and then continue as needed with the idle animation. This of course wont look perfectly smooth, but if you fire up Doom 3 on a skirmish and set the camera mode to third person. It should give you an idea of how Doom 3 itself blends its animations together.

With regards to implementing the actual interpolation between skeletal frames, have a look at the bottom of this page. He shows how to slerp the joint's rotation and lerp the joint's position. [smile]

All the best,
ViLiO

Share this post


Link to post
Share on other sites
I've been playing around with this lately and got reasonable looking results by just blending the run anim with the idle anim according to how fast the player is moving, so that at top speed only the run anim is shown.
This will cater for any speed in between, so it does a reasonable job of the 'slowing down to stop' transition that you are talking about - unless your character stops instantaneously of course.

Share this post


Link to post
Share on other sites
thanks guys.

so for the implementation itself, i would have to do 3 interpolations, right?

animation1 = interpolation(frame(x) to frame(x+1))
animation2 = interpolation(frame(x) to frame(x+1))

finalanimation = interpolation(animation1 to animation2)

right?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this