PDA

View Full Version : Lighting and display lists



DiscoBoy
10-21-2000, 12:12 AM
I've got a little problem. I'm developing a game using display lists quite a lot. When adding lighting to the scene, the called display lists are not shaded correctly. They seem to get the lighting from where the lists were created initally, even though I add the lights after the lists have been created.

Is this the way it's supposed to work, or am I doing something wrong? What can be done to fix it?

CS
10-22-2000, 03:29 AM
Originally posted by DiscoBoy:
When adding lighting to the scene, the called display lists are not shaded correctly. They seem to get the lighting from where the lists were created initally, even though I add the lights after the lists have been created.

Do You use transformations to place objects form your display list? If so, be sure you do not affect your light position.

Ex: GlTransfer ...
Set_a_light(X,Y,Z) ...
glCallList ...
... light moves with your object.

If i understand your problem right - this should solve your problem.

Set_a_light(X,Y,Z) ...
glTransfer ...
glCallList ...