Original Post
I use this routine to make an ilumination of my 3d world.
I put it before using all the glVertex3F of thw walls and the floor.
glShadeModel(GL_SMOOTH);
glEnable(GL_DEPTH_TEST);
glEnable(GL_COLOR_MATERIAL);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, @especular);
glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, 120.0);
glLightfv (GL_LIGHT0, GL_SPECULAR, @especular);
glLightfv (GL_LIGHT0, GL_POSITION, @position);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
But this routine ilumminate all my walls and my floor like they are only 1 object. But they are separated. I want to iluminate my 3d world, with the light of the sun. How to do ?
Ps.: My 3d world only have walls and a floor.