Jump to content
  • Advertisement
Sign in to follow this  
Burnt_Fyr

Animation

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

So I'm currently implementing Animation in my code, after avoiding it for such a long time. I'm sort of torn between 2 ideas right now and want some more experienced peeps to guide me.

 

Is it better to load and export animations with a strict number of Keyframes and frame rate, or just use key key frames? lets say I have a simple animation that lasts for 1 second, I could export 30 frames of this animation, or 15 skipping every other, or some other rate that makes sense.

 

This means easy math upon playback. find my current time delta, lerp between the previous frame time and next frame time based on dt.

 

OR

 

I could brake up the transformation into rotation, translation and scaling components and only key frame the important stuff, using less data to store the animation. Say the object translates each frame at a consistant speed, but only rotates at the beginning, middle, and ends. so some frames may not require complete SQT transforms.

 

Now upon playback, I have to find the last key frame that was stored for each track(SQT) and the next frame for each. and then use some mathemagic to get the current key frame for each track to combine into a complete matrix again.

 

It seems that can trade some complexity and 3x the calculation time to save some data space and loading time. Am I right to think this is a bad idea?

 

 

 

 

Share this post


Link to post
Share on other sites
Advertisement

1.) Using animations with a fixed frequency of key frames may produce a bigger memory footprint. Your animation sub-system should be able to deal with both fixed and variable frequencies. Then the decision is on the used DCC and toolchain.

 

2.) You should use separate tracks for orientation and translation (and perhaps scaling if you use it) anyway, because interpolation of combined transform matrices is possible but cumbersome and/or requires very small steps. How to combine them depends on what is animated. The animation should not know whether it is an animation of a bone or of a clock hand … it's just an orientation (as an example).

 

3.) For interpolation it plays no role how much 2 key frames are apart. Whether you look-up 1 time or 3 times where the next key frame is will probably also not be so different performace-wise.

Share this post


Link to post
Share on other sites

1.) Using animations with a fixed frequency of key frames may produce a bigger memory footprint. Your animation sub-system should be able to deal with both fixed and variable frequencies. Then the decision is on the used DCC and toolchain.

 

2.) You should use separate tracks for orientation and translation (and perhaps scaling if you use it) anyway, because interpolation of combined transform matrices is possible but cumbersome and/or requires very small steps. How to combine them depends on what is animated. The animation should not know whether it is an animation of a bone or of a clock hand … it's just an orientation (as an example).

 

3.) For interpolation it plays no role how much 2 key frames are apart. Whether you look-up 1 time or 3 times where the next key frame is will probably also not be so different performace-wise.

 

Thanks for the speedy reply, so it seems that my 2nd option, though more cumbersome and slightly more performance intensive is the best as it allows for your #2. Back to the trenches I go

Share this post


Link to post
Share on other sites

Thanks for the speedy reply, so it seems that my 2nd option, though more cumbersome and slightly more performance intensive is the best as it allows for your #2. Back to the trenches I go

It is not more performance-intensive—it is virtually always if not always the faster route in terms of run-time performance, and since it matches the output of your tool chains it is just the correct way anyway.


L. Spiro

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!