Jump to content
  • Advertisement


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


change color of polygon

This topic is 5506 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

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

Share this post

Link to post
Share on other sites
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]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!