Advertisement

Opengl Lighting

Started by December 21, 2001 12:48 PM
2 comments, last by tSG 23 years, 2 months ago
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 --
are you rotating the light with the quad?
Advertisement
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 --
-- tSG --
I update this topic to be on the top. Sorry but please help!


-- tSG --
-- tSG --

This topic is closed to new replies.

Advertisement