I'm working on a test project to learn some basic OpenGL. Right now I'm trying to work on a "camera" with gluLookAt. My camera object is really simple, I have two vectors, one for the position and the other for the rotation (x, y and z on both). I'm having trouble with the target point gluLookAt receives, how can I find a target point using only the position and camera angle?
If you have desired rotation angles for your camera, then
(Why the negatives? Because you're constructing a matrix to go from world space to camera space, so everything's opposite to the transformations that go from camera space to world space.)
The position passed to
And pass the result to