First of all you have to enable lighting with a call to "glEnable(GL_LIGHTING)".
Then you should set up your light/s with calls to "glLight".
To enable a light you have to call "glEnable(GL_LIGHT0)" to enable light 0.
VirtualNext
First of all you have to enable lighting with a call to "glEnable(GL_LIGHTING)".
Then you should set up your light/s with calls to "glLight".
To enable a light you have to call "glEnable(GL_LIGHT0)" to enable light 0.
VirtualNext
(x, y, z, 0) then it will be at Thanks, .... David
Thanks.
If the w component of the position is 0.0, the light is treated as a directional source. Diffuse and specular lighting calculations take the lights direction, but not its actual position, into account, and attenuation is disabled. Otherwise, diffuse and specular lighting calculations are based on the actual location of the light in eye coordinates, and attenuation is enabled.
P.S.: This is from the OpenGL online documentation.
VirtualNext