Original Post
Hello, I don't understand why the following code:
GL::Render()
{
GLfloat lightDir[] = {0, 1.0, 1.0, 0};
GLfloat blue[] = {0.0, 0.0, 1.0, 1.0};
// clear screen and depth buffer
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// load the identity matrix (clear to default position and orientation)
glLoadIdentity();
glLightfv(GL_LIGHT0, GL_DIFFUSE, blue);
// cut out some code here that causes the object drawn to rotate
DrawObject();
}
would result in the object being lit with a blue color as it rotates for about 45 degrees, and then the entire object dims (no lighting) for the next say 215 degrees. I would have thought that the light source is constant, so as the object rotates the portion facing the light would be lit blue. Thanks for any help!