Camera (View) Matrix - Help.

Started by
1 comment, last by ajit_kamat 18 years, 10 months ago
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
Advertisement
Quote: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?
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.
E stands for Eye vector :)
yep, you are right it should be -T.N. Thank you for the reply.

~Ajit

This topic is closed to new replies.

Advertisement