Game Development Reference
In-Depth Information
in either case, the x-axis is horizontal and the y-axis is vertical.) These
conventions in 2D are fairly standardized. In 3D, however, the conven-
tions for arrangement of the axes in diagrams and the assignment of the
axes onto physical dimensions (left, right, up, down, forward, back) are
not very standardized. Different authors and fields of study have dif-
ferent conventions. Section 1.3.4 discusses the conventions used in this
book.
As mentioned earlier, it is not entirely appropriate to say that the x-axis
and y-axis in 3D are the “same” as the x-axis and y-axis in 2D. In 3D, any
pair of axes defines a plane that contains the two axes and is perpendicular
to the third axis. For example, the plane containing the x- and y-axes is
the xy plane, which is perpendicular to the z-axis. Likewise, the xz plane is
perpendicular to the y-axis, and the yz plane is perpendicular to the x-axis.
We can consider any of these planes a 2D Cartesian coordinate space in its
own right. For example, if we assign +x, +y, and +z to point right, up,
and forward, respectively, then the 2D coordinate space of the “ground” is
the xz plane, as shown in Figure 1.10.
1.3.2
Specifying Locations in 3D
In 3D, points are specified using three numbers, x, y, and z, which give the
signed distance to the yz, xz, and xy planes, respectively. This distance
is measured along a line parallel to the axis. For example, the x-value is
the signed distance to the yz plane, measured along a line parallel to the
x-axis. Don't let this precise definition of how points in 3D are located
confuse you. It is a straightforward extension of the process for 2D, as
shown in Figure 1.11.
Figure 1.11
Locating points in 3D
 
Search WWH ::




Custom Search