View/Camera Transformation

What is view transformation ?

  • Think about how to take a photo
    • find a good place and arrange people (model transformation)
    • find a good angle to put the camera (view transformation)
    • cheese! (projection transformation)

Define the camera

  • Position
  • Look-at direction
  • Up direction

keep the camera at (0,0,0) and up direction is axis Y, look-at direction is axis -Z

$M_{view}$ in math ?

$M_{view} = R_{view}T_{view}$

Translate Matrix $T_{view}$: first move point to origin

Rotate Matrix $R_{view}$: Rotate $R_{z}$ to $-Z$, $R_{y}$ to $Y$, $R_{z} \times R_{y}$ to $X$. Consider its inverse rotation: $M^{-1}{rotate} = M^{T}{rotate}$

so $R_{view}$ is: