Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Centum

Smooth animations and synchronization

This topic is 6684 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''ve got a problem about smoothing animations and movements of objects. I use DirectX. If I''ve got the FPS how can I use it to smooth everything if FPS changes many times in a second?

Share this post


Link to post
Share on other sites
Advertisement
In my former game engine that I scrapped, I had it where every object could have a set of animations. These animations were a list of translation waypoints as well as rotation values. Both these values were for a given number of seconds. So, say I wanted to move a box forward (in the Z direction) for 10 seconds, and after 10 seconds start to move it backwards for 10 seconds. What that would look like in my .script file would be:

animation 1
translate 0,0,10 in 10 seconds
rotate 0,0,0 in 10 seconds
translate 0,0,-10 in 10 seconds
rotate 0,0,0 in 10 seconds

That being said, at the start of each new "move" (separate part of the animation sequence) I would get the FPS, check how many seconds I wanted this move to complete in (10 in the above example), and then calculate how many frames of animation that would be. Then once I knew how many frames I would be rendering for this move I would calculate dx,dy, and dz based on the information. Albeit, that was only linear interpolation, it worked well, especially for that being my first game project.

JoeG

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!