Original Post
Reposted in DX as no joy from the maths forum
I have my world objects and my camera stored in the same base class. So they each share lots of properties. Notably a world position and a quaternion specifying their rotation.
For normal objects this is great, the position vector + the rotation quaternion let me create a world Transform matrix.
The bit I''m getting confused by is the camera part. It needs to construct a view matrix.
What I have at the moment (for hack purposes) is:
Matrix.LookAtLH(new Vector3(_xPos,_yPos,_zPos), _lookAt, new Vector3(0f,1f,0f));
Where _xPos etc specify the world position, but I need a way to generate the _lookAt and Up vectors from the position+rotation I have stored.
Any suggestions?