PDA

View Full Version : I am New to Opengl. Need some help!



sumanmali
05-01-2016, 04:07 PM
Can we make the object vanish after its appearance for few seconds??
If so how to do that??

Hermannicus
05-02-2016, 08:32 PM
Just don't draw it? Or is that not what you mean?

BBeck1
05-03-2016, 06:58 PM
Can we make the object vanish after its appearance for few seconds??
If so how to do that??

I know that answer sounds a bit flippant, but it's absolutely correct. Just stop drawing it.

You should be drawing in a loop, especially if you are making games. In a game loop, each iteration of the loop is one frame. It's like drawing cartoons on film. You create animation by drawing one image each frame and moving through the frames at a rate of no less than 30 frames per second. If you want something to disappear, just don't draw it in those frames for that time period.

You should also be clearing the screen and depth buffer every frame. So, if you draw nothing, you have a blank screen.