Advertisement

Line Color

Started by May 20, 2001 03:48 PM
5 comments, last by Sarashinai 23 years, 9 months ago
I''ve been trying to use glColor3f to set the line color, but it doesn''t work. It all comes out as the color of the last texture I bound to.
You are rembering to disable Texturing if you want just colours on you lines arent you?
Forgeting the little things allways leeds to big problems, and I allways forget them.
Advertisement
The tutorials don''t disable texturing.

I tried glDisable(GL_TEXTURE_2D); before glColor3f but it didn''t change anything.
disable lighting

http://members.xoom.com/myBollux
Hi,
If you want to set the colour of something when using lighting, set the emissive material property.
Dave
Hi again,
Here''s a little bit of code that sets the both the current drawing colour and the emissive material property

GLfloat lineColour[] = {0.3f, 0.3f, 0.3f, 1.0f}; // define the colour
glColor4fv(boxColour); // set current colour
glMaterialfv(GL_FRONT, GL_EMISSION, boxColour); // set emissive material colour

Hope this helps,
Dave
Advertisement
Make sure you use glFlush() before you re-enable texturing.

Regards,
Krippy

This topic is closed to new replies.

Advertisement