Public Group

# Camera (View) Matrix - Help.

This topic is 4932 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I am having hard time understanding the camera (view) matrix: Ux Vx Nx 0 Uy Vy Ny 0 Uz Vz Nz 0 -E.U -E.V -E.Z 1 How is this matrix constructed? Why are there dot products in the translation section of this matrix? How is rotation and translation actually achieved by this matrix? Cheers, ~Ajit

##### Share on other sites
Quote:
 I am having hard time understanding the camera (view) matrix:Ux Vx Nx 0Uy Vy Ny 0Uz Vz Nz 0-E.U -E.V -E.Z 1How is this matrix constructed?Why are there dot products in the translation section of this matrix?How is rotation and translation actually achieved by this matrix?
I'm not sure what the 'E' stands for, but let's call it 'T' for translation. Also I think entry 43 is supposed to be T.N rather than T.Z?

The standard 'forward' version of this matrix might look like this:

Ux Uy Uz 0
Vx Vy Vz 0
Nx Ny Nz 0
Tx Ty Tz 1

The upper-left 3x3 portion is a rotation matrix; U, V, and N are the direction vectors of the camera. The matrix overall is the product of the matrix multiplication:

M = R*T

Where R is the rotation portion and T is the translation portion. This matrix has the effect of rotating a vector by R, and then translating it by T. For a view matrix, we need the inverse of M. Applying some matrix properties we get:

M-1 = (R*T)-1 = T-1*R-1

R-1 is simply transpose(R), and T-1 is simply T with the translation vector negated. Work through the multiplication and you'll see that it results in the matrix you posted. The effect of this matrix is to translate by -T, and then rotate by transpose(R). In other words it is the opposite of the 'forward' camera transform, and has the effect of transforming objects in world space into local camera space.

##### Share on other sites
E stands for Eye vector :)
yep, you are right it should be -T.N. Thank you for the reply.

~Ajit

1. 1
2. 2
Rutin
21
3. 3
4. 4
A4L
15
5. 5
khawk
14

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633742
• Total Posts
3013636
×