PDA

View Full Version : lighting problem



sarahippo
09-10-2003, 01:54 PM
Hi,

I have a rotating cylinder.
The problem is that when I apply lightings on it, the cylinder gets darker and darker as it rotates, and eventually it becomes black.

why?

Sourpotato
09-10-2003, 08:31 PM
How do you place your light source position?hah

sarahippo
09-11-2003, 09:58 AM
how should i place the light source?

Deiussum
09-11-2003, 01:06 PM
Probably a different way than what you do now... http://www.opengl.org/discussion_boards/ubb/smile.gif

Things to think about when placing lights that might help you figure out your problem.

1) glLightfv(..., GL_POSITION/GL_SPOT_POSITION, ...) calls are affected by the current MODELVIEW matrix.
2) glLightfv(..., GL_POSITION/GL_SPOT_POSITION, ...) calls are NOT affected by the PROJECTION matrix, so if you are putting things there that you shouldn't be, like glRotate/glTranslate/glScale, your lighting calculations won't work like they should.

1234!
09-11-2003, 06:34 PM
If things change over time, the problem is mostlikley that you dont use 'glLoadIdentity' or that your are messing with the matrixmode.

Both are common beginners mistakes.