5.1 The use of angles.
For the moment, consider orthographic projections only, on a possibly slanted viewplane, with up-vector k. Then the only piece of information needed is a viewplane normal N, which is the same thing as the viewing direction.
It is often handy to be able to specify the viewplane normal
by using angles, rather than by a vector such as . For
example, suppose you want to show successive views as you walk around
the object; in that case, it would be good to give the angle at which
the viewing direction is slanted with respect to the ground, and
an angle to tell how far around the object you have gone.
To tie angles to vectors, several schemes are possible: latitude-longitude, alt-azimuth, and spherical coordinates. These schemes are practically the same except for the choice of reference directions from which angles are measured. Let's concentrate first on latitude-longitude.
5.2 The latitude-longitude system
On the earth, a ``great circle'' is a circle that divides
the earth into equal halves; an example is the equator. Recall that
the latitude of a point on the earth is its angular distance
above the equator, and the longitude is its angular distance
east of a great circle through the north pole and Greenwich,
England (``gren-itch''). South latitude and west longitude count
as negative angles. For example, Los Angeles is approximately
at latitude
, longitude
.
Regard the earth as a unit sphere centered at the origin
in
R, with the north pole at
and the point
of latitude zero, longitude zero at
. See Figure
, which however does not indicate the viewplane and
whatever object we are trying to project.
Problem. Compute an orthographic projection of an object on the
viewplane, with viewplane normal going through the point on the
earth with latitude and longitude
, and with
up-vector
k.
Method #1. Convert the angular description of the viewplane normal to a Cartesian description, and then use our previous slanted-viewplane method.
Details: The point on the earth with latitude and longitude
can be found by starting at
on the
-axis,
then rotating by
upwards towards the
-axis, and then
rotating east by
around the
-axis. In other words,
N
,
which comes out
N
n
.
Exception: Our previous slanted-viewplane method doesn't work when
the normal is along the same line as the up-vector. On the earth,
this corresponds to views from above the north pole or below the
south pole. For those, just project directly on the -plane.
Method #2. Find directly the rotation that rotates the
viewplane to the -plane and then project orthographically
on the
-plane.
Details: Recall that under this rotation
v i,
w
j,
n
k. Although we haven't found
v and
w, we at least know that the up-vector
k
projects orthographically to the positive
w-direction in the
viewplane. In other words, the specified point on the earth
(which is at the end of the vector
n) should rotate to
where the north pole used to be (i.e., at
), and the
north pole after the rotation should project orthographically
on the positive
-axis. How can we accomplish this?
First attempt: Compose two standard rotations: Rotate the
specified point west by an angle to the
-plane and
then north by
. This does take the
specified point to
, but unfortunately the north pole
stays fixed under the first rotation and moves to a position over
the
-axis under the second. A picture of the earth made
this way would have the north pole at the side of the picture.
Second attempt: Plan ahead better. Rotate the specified point
west by an angle
, to the
-plane, and then
rotate north, as shown in Figure
. This does work, and
the rotation is thus
Bonus: This method works even for a view from above the north
pole, where
, or from below the south
pole, where
. Although the viewplane is
the
-plane in these cases, so that the up-vector does not
give any information about which way to orient the picture, you
have given that information yourself in specifying the viewing
longitude
!
5.4 Other schemes
Now, to tie this to Cartesian coordinates, impose a coordinate system
with the origin at your shoulder, the -axis headed north, the
-axis headed east, and the
-axis pointing up.
5.5 Perspective projections
As usual, consider only viewplanes that go through the origin. A perspective projection can be described by giving the direction of the viewpoint from the origin and the distance of the viewpoint from the origin. The direction can be described using angles, just as in the orthographic case. The viewplane is taken to be perpendicular to the line from the origin to the viewpoint.