Advertisement

Dynamic Lights

Started by January 18, 2004 05:22 AM
2 comments, last by NeViL tHe dEVil 21 years, 1 month ago
How can you make Dynamic Lights? The only Lights I''ve seen are the static ones initialized with the rest of GL (NeHe Tut 7) ------------------------------------------------------ Regret Nothing - Learn Everything
------------------------------------------------------ Regret Nothing - Learn Everything
Pretty simple, change the values in the LightPosition array and make a call to glLightfv(lightn,GL_POSITION,LightPosition);
Advertisement
Thx, but I just realized I need something more (or less?):
I don't want to cast light on all objects, only on one. How do I do this? Do I just call glLightfv after Drawing all objects except that one, or what?
EDIT: or do I just leave out the Normals on the Objects wich aren't to be Lighted?

------------------------------------------------------
Regret Nothing - Learn Everything

[edited by - NeViL tHe dEVil on January 18, 2004 12:59:10 PM]
------------------------------------------------------ Regret Nothing - Learn Everything
Leaving out the normals does not affect lighting, the last given normal being used for all vertices being drawn, only a new glNormalx call overrides it. To disable en enable light for only one object call glEnable(GL_LIGHTING) before and glDisable(GL_LIGHTING) after you draw the object.

This topic is closed to new replies.

Advertisement