Game Development Reference
In-Depth Information
The first sure-fire way to generate an alias is to add a multiple of 360 o
to either angle. This is really the most trivial form of aliasing and is caused
by the cyclic nature of angular measurements.
The other two forms of aliasing are a bit more interesting because they
are caused by the interdependence of the coordinates. In other words, the
meaning of one coordinate, r, depends on the values of the other coor-
dinate(s), the angles. This dependency creates a form of aliasing and a
singularity:
The aliasing in 2D polar space can be triggered by negating the radial
distance r and adjusting the angle so that the opposite direction is
indicated. We can do the same with spherical coordinates. Using the
heading and pitch conventions described in Section 7.3.3, all we need
to do is flip the heading by adding an odd multiple of 180 o , and then
negate the pitch.
The singularity in 2D polar space occurs at the origin, because the
angular coordinate is irrelevant when r = 0. With spherical coordi-
nates, both angles are irrelevant at the origin.
So spherical coordinates exhibit similar aliasing behavior because the
meaning of r changes depending on the values of the angles. However,
spherical coordinates also suffer additional forms of aliasing because the
pitch angle rotates about an axis that varies depending on the heading
angle. This creates an additional form of aliasing and an additional singu-
larity, which are analogous to those caused by the dependence of r on the
direction.
Different heading and pitch values can result in the same direction,
even excluding trivial aliasing of each individual angle. An alias of
(h,p) can be generated by (h ± 180 o ,180 o − p). For example, instead
of turning right 90 o (facing “east”) and pitching down 45 o , we could
turn left 90 o (facing “west”) and then pitch down 135 o . Although we
would be upside down, we would still be looking in the same direction.
A singularity occurs when the pitch angle is set to ±90 o (or any
alias of these values). In this situation, known as Gimbal lock, the
direction indicated is purely vertical (straight up or straight down),
and the heading angle is irrelevant. We have a great deal more to say
about Gimbal lock when we discuss Euler angles in Section 8.3.
Just as we did in 2D, we can define a set of canonical spherical coordi-
nates such that any given point in 3D space maps unambiguously to exactly
one coordinate triple within the canonical set. We place similar restrictions
on r and h as we did for polar coordinates. Two additional constraints
Search WWH ::




Custom Search