# 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.

## 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 on other sites
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 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 on other sites
Ok thanks for the help! I really appreciate it :)

1. 1
2. 2
Rutin
19
3. 3
JoeJ
16
4. 4
5. 5

• 30
• 22
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631700
• Total Posts
3001800
×