Processing math: 100%

Camera

We will use a very simple camera that only requires three vectors to define: what we are looking at, which way is up, and the camera location. Given these vectors, we can compute the basis of the camera. We will define g as the look vector, t as the up vector, and e as the position vector. The basis vectors will continue to be u v, w.

If we begin by saying that the camera is oriented so that the positive x-axis goes right and the positive y-axis goes up, then we are looking down the negative z-axis. So, the look vector will point down negative z. From this we can construct the camera basis:

w=g u=t×w v=w×u

If you make sure the look and up vector are normalized before building the basis, then the resulting camera basis is orthonormal.