• Advertisement

Archived

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

make lights blink

This topic is 5409 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
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
Hi
I want to know how to do in direct3D or openGL

I already face this question

Share this post


Link to post
Share on other sites
Reduce/increase the counter every time the key is pressed...

[edited by - James Trotter on April 29, 2003 2:32:02 PM]

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

  • Advertisement