I was looking at the sourcecode for a camera class where the view matrix was created a little differently to how I was used to, probably because It doesnt use any createlookat type helper functions.
In this code the look vector, up vector, and right vector were calculated for the view which I understand.
but then the dotProducts between the position of the camera and each of the vectors was calculated and used in the fourth row of each column.
Does anybody know of a resource that explains the maths behind this step? I understand whats happening but I dont understand why.
Also the elements in the fourth column are all set to 0 accept the last one which is 1.0 does anybody know what this is used for?
Thanks so much.
EDIT: In case its relevant the code uses Directx
Calculate camera vectors with dotproduct
This should clear up your question: http://en.wikipedia.org/wiki/Transformation_matrix
a 4x4 matrix is a combination of rotational and translational components. The way it is set up, it allows you to perform two operations with one multiplication.
a 4x4 matrix is a combination of rotational and translational components. The way it is set up, it allows you to perform two operations with one multiplication.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement