0
\$\begingroup\$

I have a matrix that defines the rotation and translation of an object, relative to (0, 0, 0). Assuming that the identity matrix defines the camera to be at (0, 0, 0) pointing at (0, 0, 1), how would I go about constructing the view matrix from the world + rotation matrix?

\$\endgroup\$
2
\$\begingroup\$

Assuming I've understood the question correctly, you need to inverse the matrix. The inverse of the matrix is a matrix such that a multiplication between it and the matrix it is an inverse of will result in the identity matrix (i.e. 1,0,0,0 ,0,1,0,0, 0,0,1,0, 0,0,0,1). I'm not sure if you're using Opengl, D3d or whatever but your library should include functions to calculate the inverse. Bear in mind that calculating the inverse is not trivial and shouldn't be done say, once per vertex - you should calculate the inverse of the view matrix only as often as you change the view position. HTH.

\$\endgroup\$
  • \$\begingroup\$ Will this actually give me the view matrix? As in, the matrix required to project world space into camera space? \$\endgroup\$ – user6279 May 8 '11 at 2:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy