Original Post
I''m trying a simple spotlight effect using projective texturing in which there''s a spotlight shinning a certain object and move from left to right. Given a light''s position and look at direction I can create the new texture coordinates for the spotlight and it works fine but I can only change the lookAt direction of the light to animate the spotlight, I can''t change both position and direction so it''ll always paralell to the object.
This is the equation to calculate texture coordinate :
MatObjectLocal*Tranpose(MatrixLightView*MatLightProj)*(x,y,z,0)
I think the culprit is how I create the LightView matrix given a position and lookat direction (I''m using D3DMatrixLookAtLH).
Thx..