Jump to content
  • Advertisement
Sign in to follow this  
Accela

Animation Speed

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

Hi, I'm not very sure where to post this since I'm newb and all. I am trying to make a small 3D game with C++ whereby the charcter will run. The modeling is done in 3DS Max, saved in MD2 together with the animation. My question is, is it possible to manipulate the speed of the running animation in C++? e.g. if the character increased its speed, the running animation's speed should follow. Thank you.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster

In order to interpolate the animation at a constant speed, you would do something like the following:

vertices = current_frame + (next_frame - current_frame) * CONSTANT * time_since_last_frame

to make the animation vary in speed, you just need to keep track of the player's speed and factor it into the above equation. e.g.:

vertices = current_frame + (next_frame - current_frame) * CONSTANT * time_since_last_frame * PLAYER_SPEED

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!