Jump to content

  • Log In with Google      Sign In   
  • Create Account


rotation animation and deltaT?


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 cozzie   Members   -  Reputation: 1078

Like
0Likes
Like

Posted 06 January 2014 - 03:56 PM

Hi,

 

I've made a nice animation including camera movement and rotation per frame.

While 'recording' the animation, I've saved the changes in position absolute (divided by time delta). So when I play the animation, I multiply by delta time, so on different hardware it runs as it should/ I want it to.

 

But when I run my animation on another machine, the result is terrible.

Both the movement looks strange, and the rotations don't seem to be OK.

So I have 2 questions:

- is my approach on recording and playing the animation OK, for movement?

- should I also multiply the rotations by time delta, if so, would I also have to 'save' them absolute, divided by time delta

Any help is appreciated.



Sponsor:

#2 imoogiBG   Members   -  Reputation: 772

Like
0Likes
Like

Posted 07 January 2014 - 10:29 AM

While 'recording' the animation, I've saved the changes in position absolute (divided by time delta).

 

 

You mean by the frame time?

 

Save the keyframes in miliseconds. 

Interpolate between keyframes using time diff. and passed time.



#3 cozzie   Members   -  Reputation: 1078

Like
0Likes
Like

Posted 07 January 2014 - 11:33 AM

Thanks. I've been thinking about it a bit longer and think I draw the same conclusion.

- change the movement and rotation data to absolute values instead of changes in movement/rotation
- based on passed time (deltaT) go no next frame or skip 1 or more frames, depending on the actual fps

If I keep my animation using changes instead of absoute positions/ rotations my animation gts messed upwhen I skip frames.

Atthe moment the animation is saved based on 50 frames per second. I have done quite some work within the timeline of the anmation, thats why I'll check which frame to go to, based on 1sec/50.

Are those assumptions right/ would this approach work?

#4 haegarr   Crossbones+   -  Reputation: 3266

Like
1Likes
Like

Posted 07 January 2014 - 12:01 PM

Simply skipping keyframes is at least a sub-optimal solution. The correct way is this:

 

1.) The animation has a duration of T seconds. It stores its values at discrete key times ki in [0,T].

2.) At game time t0 the animation should start. The instance of animation hence runs from t0 to t0+T. Mapping from game time to animation time hence requires to subtract t0.

3.) Rendering the animation is done at several time steps ti within [t0,t0+T]. For a given ti you look up the kn and km with kn being the greatest key time less than or equal to ti - t0, and km being the lowest ke time greather than or equal to ti - t0

4.) Compute the fraction f := ( ti - t0 - tn ) / ( tm- tn ) if the denominator is not zero.

5.) Interpolate the animation values belonging to kn and km using f.


Edited by haegarr, 07 January 2014 - 12:01 PM.





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