Game Development Reference
In-Depth Information
altitude, although the value is offset by Earth's radius 11 in order to make
either ground level or sea level equal to zero, depending on exactly what is
meant by “altitude.”
7.3.3 Some Polar Conventions Useful in 3D Virtual Worlds
The spherical coordinate system described in the previous section is the
traditional right-handed system used by math people, and the formulas for
converting between Cartesian and spherical coordinates are rather elegant
under these assumptions. However, for most people in the video game
industry, this elegance is only a minor benefit to be weighed against the
following irritating disadvantages of the traditional conventions:
The default horizontal direction at θ = 0 points in the direction of
+x. This is unfortunate, since for us, +x points “to the right” or
“east,” neither of which are the “default” directions in most people's
mind. Similar to the way that numbers on a clock start at the top, it
would be nicer for us if the horizontal polar axis pointed towards +z,
which is “forward” or “north.”
The conventions for the angle φ are unfortunate in several respects. It
would be nicer if the 2D polar coordinates (r,θ) were extended into 3D
simply by adding a third coordinate of zero, similar to how we extend
the Cartesian system from 2D to 3D. But the spherical coordinates
(r,θ,0) don't correspond to the 2D polar coordinates (r,θ) as we'd
like. In fact, assigning φ = 0 puts us in the awkward situation of
Gimbal lock, a singularity we describe in Section 7.3.4 . Instead, the
points in the 2D plane are represented as (r,θ,90 o ). It might have
been more intuitive to measure latitude, rather than zenith. Most
people think of the default as “horizontal,” and “up” as the extreme
case.
No offense to the Greeks, but θ and φ take a little while to get used
to. The symbol r isn't so bad because at least it stands for something
meaningful: radial distance or radius. Wouldn't it be great if the
symbols we used to denote the angles were similarly short for English
words, rather than completely arbitrary Greek symbols?
It would be nice if the two angles for spherical coordinates were the
same as the first two angles we use for Euler angles, 12 which are used
to describe orientation in 3D. We're not going to discuss Euler angles
11 Earth's radius is about 6,371 km (3,959 miles), on average.
12 It's been said that the name Euler is a one-word math test: if you know how to
pronounce it, then you've learned some math. Please make the authors of this topic
proud by passing this test, and pronouncing it “oiler,” not “yooler.”
 
Search WWH ::




Custom Search