\documentstyle[11pt]{article}
\begin{document}
\section*{Chapter 5 Solutions}
\begin{flushleft}

5.1 Eclipses (both solar and lunar) are good examples of the
projection of an object (the moon or the earth) onto a nonplanar
surface. All the maps in an atlas are examples of the use of curved
projectors. If the projectors were not curved we could not project
the entire surface of a spherical object to a rectangle.

\medskip
5.3 Suppose we want the view of a earth rotating about the sun.
Before we draw the earth, we must rotate the earth which is
a rotation about the y axis. Next we translate the earth away
from the origin. Finally we do another rotation about the y axis
to position the earth in its desired location along its orbit.
There are a number of variants of this problem such as the view
from the earth of the rest of the solar system.

\medskip
5.5 There are a number of parts to the problem. FIrst, we want a
translation of the camera to the eyepoint: $T(-eye_x, -eye_y,-eye_z)$.
Remember this matrix will be on the right of the matrix we are forming.
Next we want to form a rotation matrix. We can do this my finding the
new unit length x, y and z vectors for the camera. The desired rotation 
matrix will be composed of these three vectors. The desired z vector is the
direction the camera is pointing, a vector in the direction
$(eye_x-at_x,  eye_y-at_y, eye_z-at_z)$. We can normalize it by computing
its magnitude and dividing each component by this number. The x direction
of the camera is permindicular to both this z and the up vector (which define
a plane). We can obtain this vector by taking the cross product of 
the z we just computed and the up vector, and normalize the result. Finally
we compute new y (which is the orthogonal projection of the up vector)
by taking the  cross product of the x and z vectors.

\medskip
5.7 The result follows from the transformation being affine.
We can also take a direct approach. Consider the line determined
by the points $(x_1,y_1,z_1)$ and $(x_2, y_2, z_2)$. Any point along
can be written parametrically as $(\alpha x_1+(1-\alpha)x_2, \alpha y_1+(1-\alpha)y_2,
\alpha z_1+(1-\alpha)z_2)$. Consider the simple projection of this point
$\frac{1}{d(\alpha z_1+(1-\alpha) z_2)} (\alpha x_1+(1-\alpha)x_2,
\alpha y_1+(1-\alpha)y_2)$ which is of the form $f(\alpha)(\alpha x_1+(1-\alpha)x_2,
\alpha y_1+(1-\alpha)y_2)$. This form describes a line as the slope is a 
constant. Note that the function $f(\alpha)$ implies that we trace out the line
at a nonlinear rate as $\alpha$ increases from 0 to 1.

\medskip
5.9 The specification used in many graphics text is of the
angles the projector makes with x,z and y, z planes, i.e the
angles defined by the projection of a projector by a top view
and a side view.

Another approach is to specify the foreshorting of one or
two sides of cube aligned with the axes. 

\medskip
5.11 The CORE system used this approach. Retained objects were
kept in distorted form. Any transformation to any object that
was defined with other than an orthographic view transformed the
distorted object and the orthographic projection of the transformed
distorted object was incorrect.

\medskip
5.15 If we use $\theta=\phi=45$, we obtain the projection matrix
$${\bf P}=\left [ \begin{array}{cccc}1&0&-1&0\\0&1&-1&0\\
0&0&0&0\\0&0&0&1\end{array}\right]$$

\medskip
5.17 All the points on the projection of the point $(x.y,z)$ in the
direction $d_x,d_y,d_z)$ are of the form $(x+\alpha d_x, y+\alpha d_y,
z+\alpha d_z)$. Thus the shadow of the point $(x,y,z)$ is found by
determing the $\alpha$ for which the line intersects the plane, that is
$$ax_s + by_s +c z_s =d$$
Sunstituting and solving, we find
$$\alpha = \frac{d-ax-by-cz}{ad_x + bd_y + cd_z}.$$
Howver, what we want is a projection matrix, Using this value of
$\alpha$ we find
$$x_s=z+\alpha d_x = \frac{x(bd_y+cd_x)-d_x(d-by-cz)}
{ad_x+bd_y+cd_z}$$
with similar equatiosn for $y_s$ and $z_s$. These results can
be computed by multiplying the homogeneous coordinate point
$(x,y,z,1)$ by the projection matrix
$${\bf M}=\left[\begin{array}{cccc}bd_y+cd_z&-bd_x&-cd_x&-dd_x\\
-ad_y&ad_x+cd_z&-cd_y&-dd_y\\
-ad_z&-bd_z&ad_x+bd_y&-dd_z\\
0&0&0&ad_x+bd_y+cd_z\end{array}\right].$$
\end{flushleft}
\end{document}
