Advertisement

change color of polygon

Started by April 29, 2003 10:44 AM
0 comments, last by crossbrigade2000 21 years, 10 months ago
Hi How would I go about changing the color of a polygon. I want to be able to change it using a keystroke. Take for example that I have 6 colors defined. I want it to loop through them as I hit a key Appreciate it very much Thanks
Go to nehe.gamedev.net and check out the lessons section. You'll find out how to change colors of polygons there, and even how to texture them.
Every tutorial comes with full source too!
To change the color of a polygon you could simply use the glColor function
glColor4f( Red, Green, Blue, Alpha );
every value is in range from 0.0 (lowest) up to 1.0 (highest)
or, if you prefer the 0-255 range version, just use
glColor4ub( Red, Green, Blue, Alpha );

- Patrik Willbo

The Lord says He can get me out of this mess, but He's pretty sure you're fucked.
- Stephen (Braveheart)


[edited by - Willbo on April 29, 2003 12:54:08 PM]

This topic is closed to new replies.

Advertisement