PDA

View Full Version : Manipulating light using class



03-02-2000, 05:35 AM
I`ve created a class that holds all the light parameters neede :
Position,Direction,Specular color,Diffusion color,its index(used GL_LIGHT1 as the first and a static counter reference for the next).
The class is suppose to turn on/off (glEnable/Disable..) the light , set new values etc.
The problem : it is`nt working !!!
Must I use the usual function inside the render/Callback functions ?

Bob
03-02-2000, 07:31 AM
Erm, not working in what way? Do you get any lighting at all? Or you can't change the values? And are you sure you do glEnable(GL_LIGHTNING) to enable lights at all?

Bob

03-02-2000, 08:12 AM
Not working in manner that I can`t make things happen !!!
I assume the problem is getting The glEnable/glDisable enumrator working .

paolom
03-03-2000, 05:28 AM
Why are you using GL_LIGHT1 as the first?
Use GL_LIGHT0.
Implementations could limit the number of lights, and you are supposed to use the first available set.
Also, check out specs about default light parameters. LIGHT0 has different defaults from the others.