Archived

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

minerjr

Moving Lights

Recommended Posts

I am working on my light engine. I am using the default lighting in Direct X 7. I am tring to make a point light follow my camera so I will be like a tourch that only illuminates the area around the character. I am having trouble trying to move the light. I does not seem to move at all. I am trying to change the light''s position everytime the character moves. It does not seem to work. I was wondering if you have to disable the light then change it and re-enable it again. Thanks in advance for any help you can offer. Minerjr

Share this post


Link to post
Share on other sites
You need to call SetLight() again to pass the updated parameters to the device. D3D takes a copy of the structure you pass to SetLight - it doesn''t keep track of what''s in your D3DLIGHT structure!.

LightEnable purely tells D3D lights which of the currently set lights it should be taking into account for it''s calculations.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites