🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

how do i know where a light is relative to the object coordinate system?

Started by
0 comments, last by choko 23 years, 11 months ago
I''m trying to do a shadow casting demo, but at a certain moment in my program i need to know where a light is relative to my object coordinate system. I tryed it with glGetLightfv(GL_LIGHT0, GL_POSITION, etc.) but it returns the position relative to the world coordinate system. Is there a function that returns what i want it to return, or i''ll have to use an inversed matrix? I tryed it also with an inversed matrix, but it doesn''t work. Anyone can help me?
Advertisement
Use that inversed matrix, it''s actually easy to implement than you thing. Or you can learn 3d matrix math, edit that matrix as you would the modelview matrix, and apply those changes to the light coords.

This topic is closed to new replies.

Advertisement