PDA

View Full Version : Lighting



abhiboy007
12-16-2001, 08:10 PM
I've made a cube with 3 light sources placed at x, y and z axis. how to turn it OFF and ON Individually ie. R to toggle Red, G for green and B for Blue.

How to hide the image in dark. when a light is on only selected part is visible.

Morglum
12-17-2001, 09:30 AM
Assuming that your 3 lights are GL_LIGHT0, GL_LIGHT1, and GL_LIGHT2. Then to turn on GL_LIGHT0, just call glEnable (GL_LIGHT0)...
And to turn off GL_LIGHT2, call glDisable (GL_LIGHT2).