mllobera said:
Originally as I move through a terrain, I was moving the camera position but not the focal point it was looking at.
Now i'm a bit confused about the definition of ‘focal point’ too.
Do you mean something like a locked target, which we then circle around but keep looking at? Or, clicking a vertex in a 3D modeling tool, and then camera keeps focused at the vertex, and movement orbits the selection?
Ofc. such orbiting camera mode has problems if the camera is at the center of its interest. The difference vector becomes zero, so we can no longer calculate a robust forwards direction to look at.
mllobera said:
So the idea of keeping the focal point tethered to the center of the window, as @joej suggested, seemed correct to me. However, the problem now is that when the center of the screen points at the sky, depending on how I continue to move, my direction of projection keeps on pointing more and more into the sky (does this make sense?).
Now this sounds like the standard first person shooter camera. There is no center to keep focused at, instead we can rotate the camera freely around itself, which also sets the forwards direction for movement.
But if you look straight upwards (or downwards) while standing on a flat plane, the upwards view vector projected to the ground plane becomes zero, so we can't robustly calculate the direction of movement.
The standard solution is to use two Euler Angles for a FPS camera. One angle controls the forwards vector perpendicular to the up vector. You set it with moving mouse left and right.
The second angle controls looking up or down, and we usually clip it to the maxima of -90 degrees to 90 degrees, so you can not ‘overspin’ while looking up to look backwards while still moving forwards.
Using the third Euler Angle would allow to tilt the camera, as seen in the game Quake when the player dies. But that's not really useful while playing and usually omitted to avoid player confusion.
A game which did use full freedom across all axis was Descent. In this game you do not really need a sense of what's up or down, so confusion does not come up.
mllobera said:
I am indeed moving the camera position with the cursor keys.
Why? Controlling camera with mouse is the greatest invention of 3D gaming? :D
It's key for good first person immersion console game pads can not deliver.
But ofc. it depends on the game which kind of camera works best. However, all our input devices are limited. Mouse is best, but has only 2 axis to navigate 3D space. So there always is some compromise to make.
But it should work to replicate the camera of a certain game you know.