Jump to content
  • Advertisement


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


more detail = slower overall speed

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

how do you change your ogl programs so that detail only effects your frames per second and not the timing? for example a ball going from one place to another while it''s slower if it has a background.

Share this post

Link to post
Share on other sites
you need to using some timing mechanism to work out how much time has elapsed between frames ... here''s an example

say you want a cube to rotate 360 degrees every second, here''s the psuedo-code

t1 = time(in milliseconds)

t2 = current time(in milliseconds)
draw background (what you call detail)
rotate cube 360/((t2 - t1) / 1000)
draw cube
goto loop

this is basically the same as saying speed = distance / time ... therefore knowing a given speed, and how much time has elapsed, you can work out how far an object would have travelled in a given time period!

i know that''s a bit muddled! but i''ve only just woken up!

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.

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!