Defining the camera for rendering a scene
Before we start to implement any of the camera systems for our game, we should understand the principles and mathematics of how a camera system works.
Basic properties of a camera system
The camera can be placed, moved, rotated, and zoomed to control the player’s view of the game scene. Different types of 3D cameras serve various purposes, and they are implemented depending on the gameplay style or specific needs of the game.
However, the following basic camera properties are common to the implementation of almost any kind of camera system in video game programming:
- Position and orientation: The camera’s position and orientation (rotation) define where the player is looking. Sometimes, the term “look-at” direction is used to represent the camera’s orientation.
- Field of View (FOV): This controls the amount of the game world the player can see at once, simulating peripheral vision...