Game Development Reference
In-Depth Information
Comprehending the orbit camera
A camera that rotates around the target and looks at it at all times is called an orbit
camera. An orbit camera can also be understood as a camera that moves along the
surface of a sphere. Hence, the location of a camera is defined by three parameters:
Azimuth , Elevation , and Radius , as shown in the following figure:
z
Viewpoint
y
Target
Elevation
x
Azimuth
-y
However, in our code, we will not use the terms Azimuth and Elevation, but will
stick to using yaw and pitch. We do so as Azimuth and Elevation are absolute angles
but yaw and pitch use incremental angles.
The third parameter is the radius. We use the term "distance" instead. In orbit
cameras, we generally define boundaries by using the minimum and maximum
distances from the target.
Let's understand the orbit camera better through code in the following sections.
Implementing the orbit camera
For the calculations of the orbit camera, remember the rule that the left vector of
the orbit camera will always be perpendicular to the global y axis (that is, the global
up vector).
 
Search WWH ::




Custom Search