Game Development Reference
In-Depth Information
We don't use cylindrical coordinates much in this topic, but they are
useful in some situations when working in a cylinder-shaped environment or
describing a cylinder-shaped object. In the same way that people often use
polar coordinates without knowing it (see
Section 7.2)
,
people who don't
know the term “cylindrical coordinates” may still use them. Be aware that
even when people do acknowledge that they are using cylindrical coordi-
nates, notation and conventions vary widely. For example, some people
use the notation (ρ,φ,z). Also, the orientation of the axes and definition
of positive rotation are set according to whatever is most convenient for a
given situation.
7.3.2
Spherical Coordinates
The more common kind of 3D polar coordinate system is a spherical coordi-
nate system. Whereas a set of cylindrical coordinates has two distances and
one angle, a set of spherical coordinates has two angles and one distance.
Let's review the essence of how polar coordinates work in 2D. A point is
specified by giving a direction (θ) and a distance (r). Spherical coordinates
also work by defining a direction and distance; the only difference is that in
3D it takes two angles to define a direction. There are also two polar axes
in a 3D spherical space. The first axis is “horizontal” and corresponds to
the polar axis in 2D polar coordinates or +x in our 3D Cartesian conven-
tions. The other axis is vertical, corresponding to +y in our 3D Cartesian
conventions.
Different people use different conventions and notation for spherical co-
ordinates, but most math people have agreed that the two angles are named
θ and φ.
9
Math people also are in general agreement about how these two
angles are to be interpreted to define a direction. The entire process works
like this:
Step 1.
Begin by standing at the origin, facing the direction of the horizon-
tal polar axis. The vertical axis points from your feet to your head.
Point your right
10
Locating points in 3D
using polar coordinates
arm straight up, in the direction of the vertical
polar axis.
Step 2.
Rotate counterclockwise by the angle θ (the same way that we did
for 2D polar coordinates).
9
φ is the Greek letter phi, which is pronounced “fee” by most people. Some people
prefer to make it rhyme with “fly.”
10
We mean no prejudice against our left-handed readers; you may imagine using your
left arm if you wish. However, this is a right-handed coordinate system, so you may
feel more o
cial using your imaginary right arm. Save your left arm for later, when we
discuss some left-handed conventions.
Search WWH ::
Custom Search