Skip to main content
GameDev.net gamedev.net
🔒 Locked

spotlight direction

Started by malyskolacek Jan 17, 2002 at 6:46 AM 0 replies 450+ views
Original Post
malyskolacek
malyskolacek
Hi, I have a light class, in which the light is represented by a cone(mesh) and I want the light to shine in the direction the cone is pointing at. For example I want to rotate the mesh 50degrees on the X-axis and 30degrees on the Y-axis. And I don''t know how to get the Direction member of D3DLIGHT8 to match the mesh''s direction accordingly.
S1CA
S1CA
Transform the "direction" vector of the light by the same matrix you use to rotate the mesh and it will work.




--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.