How to make an object blink with OpenGL?
-
Hi! In a window, there are several triangle objects. I want one of these to blink if I hit a button that is related with. I don't want to use any MFC etc, only standard c++ and OpenGL. Is there any good way? Yonggoo
Yonggoo wrote:
How to make an object blink with OpenGL?
Shine a really, really bright light in its eyes ;) Seriously though, I think the only way is to add/remove your object to/from the scene at the speed you want it to blink at.
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
-
Hi! In a window, there are several triangle objects. I want one of these to blink if I hit a button that is related with. I don't want to use any MFC etc, only standard c++ and OpenGL. Is there any good way? Yonggoo
Ryan is correct. OpenGL has no memory of the previous frame, you redraw it each time. Though there are shortcuts for repeated structures to shorten and speed up operations, you are drawing each frame one at a time, so blinking, you basically don't draw it (or draw it with a very dim grey, or don't alternate shining a light on it and away). This provides the blinking. _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)