Archived

This topic is now archived and is closed to further replies.

crossbrigade2000

make lights blink

Recommended Posts

Guest Anonymous Poster
Hi to all
This sounds very fascinating. Please post the code when you have it running.
Looking forward to it.

Share this post


Link to post
Share on other sites
You could possibly use a simple reducing counter..

Use red, green and blue values at 1.0f, 0.5f, 0.0f and have two values to indicate full and low intensity, have this as 1.0f and possibly 0.002f (for very dark)

in the InitGL set the variables (as an example).

int counter = 1000;
float high = 1.0f;
float low = 0.002f;
float intensity = 0.0f;

in the main draw function you can reduce the counter by one..

counter--;
if (counter < 20)
{
intensity = high;
glColorf(red * intensity, green * intensity, blue * intensity);
if (counter = 0)
{
// reset the counter when zero
counter = 1000;
}
}
else
{
intensity = low;
glColorf(red * intenisty, green * intensity, blue * intensity);
}




Share this post


Link to post
Share on other sites
I had the same problem and solved it turning on and off the lights at a given frequency...
It should not be too difficult...

Ther are 10 type of people:
those who knows binary code
and those who doesn''t

Share this post


Link to post
Share on other sites