I've been reading several sources in the web about transforming world-space points into camera-space ones. I am building my view-matrix from the following parameters
1. Camera position
2. Point the camera is looking at
3. Up vector
I perfectly understand the meaning of each of the parameters, however, there are still some doubts.
- How is the direction vector built? We have camera position and lookat position, is it camPos-lookatPos or lookatPos-camPos? In other words, does the direction vector aligns with (goes in the same direction of) the world +z-axis or is opposite to it? Direction is a bit confusing since it makes me think it goes the direction the camera lens is pointing to.
- What's the reasoning behind translating the camera to the origin? How does this simplifies math?
My view matrix looks like follows
$$V = \begin{matrix} Rx & Ry & Rz & 0 \\ Ux & Uy & Uz & 0 \\ Fx & Fy & Fz & 0 \\ -CamPosx & -CamPosy & -CamPosz & 1 \end{matrix}$$
- Will this V matrix convert from camera to world or from world to camera coordinates? How can I understand which direction it is going?