Why is my model lit so incorrectly.

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

When you set the color of a model that you are going to light, use glMaterialColor*(), not glColor.

Chris

I presume that you mean in my case
glmaterialcolor3f.

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

It’s glColorMaterial3f(…)

j

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

Originally posted by j:
[b]It’s glColorMaterial3f(…)

j[/b]

Oops - right