Jump to content

  • Log In with Google      Sign In   
  • Create Account

Animation


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1   Members   -  Reputation: 1622

Like
0Likes
Like

Posted 27 January 2014 - 12:07 PM

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?

 

 

 

 



#2   Crossbones+   -  Reputation: 7132

Like
0Likes
Like

Posted 27 January 2014 - 12:59 PM

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.



#3   Members   -  Reputation: 1622

Like
0Likes
Like

Posted 27 January 2014 - 01:12 PM

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



#4   Crossbones+   -  Reputation: 24528

Like
0Likes
Like

Posted 28 January 2014 - 03:09 PM

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




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.




PARTNERS