PDA

View Full Version : problem with opengl lighting



ninjarider
07-25-2005, 10:11 AM
among my glenables i have the following
glShadeModel GL_SMOOTH
glEnable GL_NORMALIZE
glEnable GL_CULL_FACE
glFrontFace GL_CW
glEnable GL_LIGHTING

glLightfv GL_LIGHT0, GL_POSITION, {1,1,1,1}
glLightfv GL_LIGHT0, GL_DIFFUSE, {1,1,1,1}
glEnable GL_LIGHT0

glMaterialfv GL_FRONT, GL_AMBIENT_AND_DIFFUSE, {1,.5,.2,0}

im wondering if theres a way to set the color of a polygon by using glcolor3f instead of having to call glMaterialfv everytime i want to change a polygon color?

07-25-2005, 04:00 PM
Have you tried enabling GL_COLOR_MATERIAL?

ninjarider
07-26-2005, 03:19 AM
sweet dude. thanks for that.