next up previous
Next: o_projs32 Up: o_projs32 Previous: o_projs32

5. Specifying viewing direction by angles

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 $ (1,1,1)$. 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 $ 34 ^\circ $, longitude $ -118 ^\circ $.

Regard the earth as a unit sphere centered at the origin in R$ ^ 3$, with the north pole at $ (0,0,1)$ and the point of latitude zero, longitude zero at $ (1,0,0)$. See Figure [*], which however does not indicate the viewplane and whatever object we are trying to project.

Figure: A coordinatization of the earth
.4book/05dir/earth.ps

Problem. Compute an orthographic projection of an object on the viewplane, with viewplane normal going through the point on the earth with latitude $ \theta$ and longitude $ \phi$, 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 $ \theta$ and longitude $ \phi$ can be found by starting at $ (1,0,0)$ on the $ x$-axis, then rotating by $ \theta$ upwards towards the $ z$-axis, and then rotating east by $ \phi$ around the $ z$-axis. In other words, N$ = (1,0,0){R _ {\theta} ^ {x\rightarrow z}}{R _ {\phi} ^ {x\rightarrow y}}$, which comes out N$ =$   n$ = (\cos \theta \; \cos \phi, \cos \theta \; \sin \phi,
\sin \theta)$.

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 $ x,y$-plane.



Method #2. Find directly the rotation that rotates the viewplane to the $ x,y$-plane and then project orthographically on the $ x,y$-plane.

Details: Recall that under this rotation v$ \mapsto$   i, w$ \mapsto$   j, n$ \mapsto$   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 $ (0,0,1)$), and the north pole after the rotation should project orthographically on the positive $ y$-axis. How can we accomplish this?

First attempt: Compose two standard rotations: Rotate the specified point west by an angle $ \phi$ to the $ x,z$-plane and then north by $ {\frac{\displaystyle \pi}{\displaystyle 2}} - \theta$. This does take the specified point to $ (0,0,1)$, but unfortunately the north pole stays fixed under the first rotation and moves to a position over the $ x$-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 $ \frac {\pi}2 + \phi$, to the $ y,z$-plane, and then rotate north, as shown in Figure [*]. This does work, and the rotation is thus

5.3 \framebox{\({R _ {\frac{\pi}2 + \phi} ^ {y\rightarrow x}}{R _ {\frac{\pi}2-\theta}
^ {z\rightarrow y}}\)}.

Figure: The direct method
.4book/05dir/earth.ps

Bonus: This method works even for a view from above the north pole, where $ \theta = {\frac{\displaystyle \pi}{\displaystyle 2}}$, or from below the south pole, where $ \theta = -{\frac{\displaystyle \pi}{\displaystyle 2}}$. Although the viewplane is the $ x,y$-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 $ \phi$!



5.4 Other schemes

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.




next up previous
Next: o_projs32 Up: o_projs32 Previous: o_projs32
Kirby A. Baker 2002-01-28