Implementing an FPS camera and I need some help on horizontal orientation.
I have the default view direction of (0, 0, -1), right vector of (1, 0, 0) and up vector of (0, 1, 0).
The approach that I have taken is as follows:
- To turn left or right, the right vector is added or subtracted to the view direction and the right vector is 'realigned' by taking the cross product of the view direction and up vector.
- To look up or down, the up vector is used instead of the right vector.
The problem with this approach is that when the camera looks up or down, the left and right keys do no work they way I want them to. The orientation is like a tilted disc where turning left/right distorts the horizontal orientation.
What have I not considered?