Original Post
Hi, Im having a little trouble with matrices. I have set up a view matrix that I am spinning around using the mouse. However, What I want to do is set up a directional light pointing towards where I am facing (the view).
so I have a D3DXMATRIX member variable representing the current view matrix. I use this in the SetTransform(..) so I know the matrix is getting changed ok.
Once I change the view, what I need to know is how to obtain the vector facing the direction of the view. Imagine you are a camera on the end of a torch, I need to find the direction vector required to set the directional light.
i.e. 0.0f 1.0f 0.0f if my cam is pointing along the y axis.
Is there an easy way to obtain this vector, I dont know too much about Dot Products, or cross products, are these the key to what I am looking for?
Hope you can help
[edited by - MatthewEva on March 30, 2004 8:19:29 AM]