Skip to main content
GameDev.net gamedev.net
🔒 Locked

speed

Started by derjerg Jun 27, 2009 at 9:39 AM 3 replies 2.3k views
Original Post
derjerg
derjerg
i really enjoy learning open gl through this amazing tutorial and i get along with it really great. theres just one problem. the programs run much to fast. is there a general way to reduce speed? i think its not the best way just reducing rotation-values, right? thank you in advance, jerg
deadstar
deadstar
You should update your rotation using Delta time. You need a function to return the time elapsed since the last frame, and use it something like:

Rotation += 0.1f * GetDeltaTime();


That will give you a constant rotation speed regardless of the FPS.
"The right, man, in the wrong, place, can make all the dif-fer-rence in the world..." - GMan, Half-Life 2   A blog of my SEGA Megadrive development adventures: http://www.bigevilcorporation.co.uk
derjerg
derjerg
thank you for your quick answer. this idea sounds great.
eeehm, my skills just aint good enough to implement it, though i tried doing it on my own, after i found some information about getdeltatime().

could someone please be so kind to modify lesson 9's source?
derjerg
derjerg
that would be awesome!
i'm a little stucked..

Topic Locked

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

Sign in to reply to this topic.