I am confused on how to convert world space coordinates to camera coordinates.
My current understanding is that I would need to calculate the camera space vector where
n = eyepoint - lookat
u = up(0,1,0) X n(normalized)
v = n X u
Then once I have < U, V, N > would I simply multiply each point by ?
Lets assume:
Now first construct an orthonormal frame:
In order to transform the global coord frame into the cam-coord frame you can apply the following matrix M_R:
If your cam is not positioned at global origin you also have to apply a translation M_T:
In the end your complete transformation matrix from global to cam-coords is:
I think there is an error in previous post
this matrix
should be(I test it in openGL, this one is right)