PDA

View Full Version : Why is my model lit so incorrectly.



stockton
05-10-2001, 06:17 AM
I have a model rotating which works fine but when I add a a light source the model becomes the colour of the light source and you cannot see any of the original colour.

If anyone wants a screenshot then email me: stockton@coventry.ac.uk

Thanks

Simon

chennes
05-10-2001, 07:39 AM
When you set the color of a model that you are going to light, use glMaterialColor*(), not glColor.

Chris

stockton
05-10-2001, 07:48 AM
I presume that you mean in my case
glmaterialcolor3f.

I tried this but the program won't compile glmaterialcolor3f is not recoqnised.

j
05-10-2001, 08:39 AM
It's glColorMaterial3f(...)

j

stockton
05-10-2001, 08:48 AM
I don't know if this is what you ment but firstly I did

glColorMaterial GL_FRONT, gl_diffuse
glEnable GL_COLOR_MATERIAL

but also used

glColor3f for each color that I set

chennes
05-10-2001, 10:07 AM
Originally posted by j:
It's glColorMaterial3f(...)

j

Oops - right http://www.opengl.org/discussion_boards/ubb/smile.gif