• Advertisement
Sign in to follow this  

opengl spotlights

This topic is 3887 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

hi! i am writing a program in c++ using opengl an i am having trouble placing a spotlight. I am tring to draw a lamp on a table and have the light point downwards. Thing is whenever i code the spotlight it doesnt stay in the same place and just follows the camera around! any ideas? thanks

Share this post


Link to post
Share on other sites
Advertisement
You aren't applying the matrices correctly, so the view matrix is affecting the light, or something to that effect. It's hard to say exactly what's wrong from that description, but it's along those lines.

There is an opengl forum by the way.

Share this post


Link to post
Share on other sites
Set the light positions after applying the transformation (MODELVIEW) matrix. You must do this every frame if you want the light to remain a one place w.r.t the world.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement