PDA

View Full Version : current color



huangzl99
09-05-2001, 08:37 AM
after a use texture to an object, the current color is changed to some kind color of the texture(I don't know how come). can I change the current color back?

09-05-2001, 09:35 AM
the state of the drawing color stays the same as long as you do not change it, if you want to make a green cube:
r,g,b,a
glColor4f(0,1,0,1);
//draw cube

set the color you want before drawing.

Randolph
09-05-2001, 12:17 PM
A little correction: glColor4f may mean not only diffuse or ambient color, it depends on last state of color-material, if GL_COLOR_MATERIAL is enabled, surely.
If you wanna change whole material with _all_ properties use glMaterial functions.

zed
09-05-2001, 04:27 PM
cause gl retains the last state something was set to u need to make sure the colour is the apporopiate one for what u need (most likely white in your case huangzl)
glColor4f(1,1,1,1);
colour is now white