Jump to content
  • Advertisement
Sign in to follow this  
Hannesnisula

How do animations work?

This topic is 3311 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'm going to create my own animation system and I know how to interpolate between them etc but I don't know how they work in detail. How are they stored? 1 keyframe + the time until that keyframe is "reached"? If my animation consists of multiple keyframes, do I just calculate between the one I'm going to get to and the one before that? If you want to tell me I shouldn't do it or it's pointless or w/e (as I most often get) please don't bother replying. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
I think it's worth so search in Google. You can study some animation files structures, compare them, then improve and create yourself system :)

Share this post


Link to post
Share on other sites
yes as u asumed ur animation might consist of multiple keyframes and ul need to keep track of the amount of time that should pass between two adjacent keyframes.

for calculating all the inbetween frames u should use Slerp (spherical linear interpolation - just google it :P). slerp basicly takes 2 rotations and a value between 0 and 1. This value wil represent the "progress" between key frames where 0 would be "the previous keyframe" and 1 would be the "current".
so if the key frames are 2 seconds apart a value of 0.5 would mean youre exactly halfway (1s) between key frames. You will need to perfrom slerp on each angle in your models skeleton to get the final current frame.

Hope that helps :p

EDIT - there is of course simpler methods of interpolation than slerp but they wil not neccesarily yield smooth animations

[Edited by - EternityZA on June 22, 2009 6:46:49 AM]

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!