Opengl Lighting
Why can it be that if I set up a point-light under opengl
then if I turn it is getting darker?
Might be there a normal-vector problem?
How must I provide normal-vectors: in world-space or in local-space?
Anyway I use that code to draw a quad:
glBegin(GL_QUADS);
glColor3f(1,1,1);
glNormal3f(0,0,1);glTexCoord2f(0,0); glVertex3f(0,0,0);
glNormal3f(0,0,1);glTexCoord2f(1,0); glVertex3f(50,0,0);
glNormal3f(0,0,1);glTexCoord2f(1,1); glVertex3f(50,50,0);
glNormal3f(0,0,1);glTexCoord2f(0,1); glVertex3f(0,50,0);
glEnd();
And I set up lighting at the beginning of the program. After
a glLoadIdentity() call if this counts...
-- tSG --
-- tSG --
Good question!
Well, I''m rotating the camera in my code but in opengl
there is not cameramatrix, it is included in the
modelview-matrix. Interresting issue
So, in theory I have to move the light-position also, right?
But why doesn''t it work if I call glEnable(GL_LIGHT0)
after I have loaded the camera-matrix into GL_MODELVIEW?
Do I have to perform personally the position*cam.matrix
multiplication?
Thanks in advance
-- tSG --
Well, I''m rotating the camera in my code but in opengl
there is not cameramatrix, it is included in the
modelview-matrix. Interresting issue

So, in theory I have to move the light-position also, right?
But why doesn''t it work if I call glEnable(GL_LIGHT0)
after I have loaded the camera-matrix into GL_MODELVIEW?
Do I have to perform personally the position*cam.matrix
multiplication?
Thanks in advance
-- tSG --
-- tSG --
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement