How to create an Animation in OpenGL ?

Started by
1 comment, last by shotgunnutter 16 years, 3 months ago
How can I make an Object that I render in OpenGL move along a given line? And I want to have Play key and Pause key like Music Player ? What do I have to do? please, help me
Advertisement
Create a timer that tracks elapsed time. At regular intervals, update your elapsed time and then update the position of your object so that it traverses the line. If you define your line as a parametric equation:
p = p0 + t·u
p will be the position of the object at elapsed time t.
To play and pause, have a flag that you set on a key press. If the flag is true, update the elapsed time, otherwise, don't update elapsed time (t will not change, so p will not change, and so the object will not move).
"When you die, if you get a choice between going to regular heaven or pie heaven, choose pie heaven. It might be a trick, but if it's not, mmmmmmm, boy."
How to Ask Questions the Smart Way.
If you are looking for a GUI library to use within an OpenGL application, I recommend CEGUI. (Crazy Eddies GUI). Google for it.
I just wanted to see if he would actually do it. Also, this test will rule out any problems with system services.

This topic is closed to new replies.

Advertisement