• Advertisement

Archived

This topic is now archived and is closed to further replies.

Dynamic Lights

This topic is 5145 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Pretty simple, change the values in the LightPosition array and make a call to glLightfv(lightn,GL_POSITION,LightPosition);

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement