GLUT slowdown possible?

Hi,
I was wondering if anyone knows how to slow down the refresh rate while using glut. I have things falling, and they fall too fast, and I can’t change the amount they fall per redraw. Any ideas?

Thanks,
gabe

An important thing to learn (whether for GLUT or not) is how to do time-based animation rather than frame-based animation.

That is, if some time dt has elapsed since you last drew something moving with a velocity v, it has moved a distance v*dt.

If you just want things to fall in discrete steps, keep track of how much time has elapsed since the last such step, and if that amount is large enough, step again.

You’ll find glutGet(GLUT_ELAPSED_TIME), which returns milliseconds, useful.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.