2
\$\begingroup\$

I found these slides which go through the viewing transform in what I think is a easy way. However, I have hard time understanding two thigs:

  1. What would be the implication of using a right-hand coord system when building this matrix?
  2. In order to get the final camera-to-world matrix, I thought I should do a matrix composition, i.e. C = T * R. Why on slide 18, it just puts the translation vector in the last column instead of doing such a multiplication?
\$\endgroup\$
1
\$\begingroup\$

1) the negative Z would be in front of the camera (and the positive behind it)

2) because of the shape of the matrix (and the many zeros in it). you can do the multiplication by hand, you will end up with the matrix as it is written (with the translation in the last column)

\$\endgroup\$
1
\$\begingroup\$

Handedness is referred to as 'chirality'.

Moving the camera "left" is the same as moving the world "right". The ViewMatrix can actually be constructed by inverting the world matrix you'd construct to draw a piece of geometry representing the camera. Applying the ViewMatrix, literally, un-moves, then un-rotates the world to where the camera becomes (0,0,0) and whatever direction the camera is facing becomes "into the scene".

The chirality of the ViewMatrix simply determines whether the direction of "into the scene" refers to (0,0,1) or (0,0,-1). With either chirality, (1,0,0) is "right" and (0,1,0) is "up".

I refer to this diagram whenever I've confused myself:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb204853(v=vs.85).aspx
Notice that while both arms are pointing the same direction, the thumbs, both pointing in the Z+ direction, are opposite.

Re #2:
I agree with user75844; that's just how the math works out.

\$\endgroup\$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.