I have an API which takes a 4x4 OGL Matrix as input. I have to my disposal a Camera in a 3D space. The camera itself has xyz coordinates, attached to it is a target which also has xyz coords. Both of these can be moved around indepently.
What I want to do is use the information from these two entities to construct a 4x4 OGL Matrix, which has the same position in 3D space as the camera.
As I understand it, the diagonal of the Matrix represents the position of the eye(camera).
Code :1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0
This would "place" my camera at (1.0, 1.0, 1.0) If I'm correct?
Apart from this I need to calculate the angle/direction of the camera to properly match it. Any hints or suggestions are greatly appreciated.
Edit: Sigh, after this advanced post I just found gluLookAt, which probably does the exact thing I'm after... I'm such as bad googler. You may still reply to this thread though if I'm going in the complete wrong direction.