Jump to content
  • Advertisement
Sign in to follow this  
ehmdjii

animation blending in skeletal based models (md5)

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

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
Advertisement
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
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!