How to create an Animation in OpenGL ?
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
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).
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).
If you are looking for a GUI library to use within an OpenGL application, I recommend CEGUI. (Crazy Eddies GUI). Google for it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement