Hi, I have a problem using openGL light.
I draw two 3D .obj model. Loader works fine, vertex and normals are correct. The problem is that when I enable light the effect on one of the model is bad:
good model with light:
[ATTACH=CONFIG]160[/ATTACH]
bad model with light:
[ATTACH=CONFIG]161[/ATTACH]
bad model without light
[ATTACH=CONFIG]162[/ATTACH]
Here is the light code in render function:
gluLookAt(20.0f, 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
glEnable(GL_LIGHT0);
glEnable(GL_LIGHTING);
float lightPos[] = {20.0, 10, 1, 0.0};
glLightfv(GL_LIGHT0, GL_POSITION, lightPos);
// here draw model
Any suggestions? Light params are incorrect?