Sign in to follow this  
digsydave

opengl spotlights

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this