Skip to main content
gamedev.net
🔒 Locked

Animation timing...

Started by JimmyP 0 replies 550+ views
Original Post
JimmyP
JimmyP
Let''s say I have an object stored in a display list and I want to make it move along the screen say 10(from 0.0 to 10.0) units on the x axis.I could do something like: x=x+0.5f; //or whatever makes the animation smooth and fast glTranslatef(x,0.0f,0.0f); glCallList(dlist); and make sure x stays within 0 and 10 etc etc. Now the problem is that on a slow machine this might take ages while on a fast one it might be done too fast.So I need way to time the whole animation.For example: the object should cover the whole 10 units in say one second.This way it will move the same in every machine with the only difference that with the fast machine the animation will be smoother. Is this timer the best way to handle this problem or is there a better one and if it is what is the best way to implement such a timed animation. -=Jimmy=-
-=Jimmy=-
soreno
soreno
http://nehe.gamedev.net/tutorials/lesson21.asp

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.