\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{epsfig}


\textheight= 9in
\textwidth=5in
\parindent =0pt
\hsize = 4in
%\voffset = 1 in
%\hoffset= 1 in
\parindent = 0pt
\parskip = 0.2cm
\tolerance = 10000
\input{../../../../papers/newcomm}

\begin{document}
\bibliographystyle{plain}

{\bf  Computer Graphics Intro}\hfill \today \hrule {\bf G. Farin }
\hfill \fbox{ \bf Name:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}\\

\hfill \fbox{ \bf ASU ID:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}


\vskip 1cm
\begin {center} {\bf  Midterm }\\
\end {center}


{\bf 1.} Let a $4\times 4$ matrix be given by
$$
    \begin{bmatrix}2 & 0 & 0 & 2\\
                    0 &2 & 0 & 2\\
                    0 &0 & 2 & 2\\
                    0 & 0 & 0 & 1
    \end{bmatrix}.
$$
When interpreted as an affine map, what is the action of this
matrix?

\vspace{3cm}

{\bf 2.} Let a 3D (oriented) triangle be given by the vertices
$$
    \pp_1=\begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix},~~
    \pp_2=\begin{bmatrix} 0 \\6 \\  0\end{bmatrix},~~
    \pp_3=\begin{bmatrix}  0 \\ 0 \\ 1\end{bmatrix},~~
$$
Find the normalized normal to this triangle.

\vspace{3cm}

{\bf 3.} What is the aspect ratio of a rectangle? Will it change
when an affine map is applied to the rectangle? Explain.

\vfill \eject

{\bf 4.} What is a viewing frustum? Draw a 2D sketch and label it.

\vspace{4cm}

{\bf 5.} Can an affine map take a rectangle to a parallelogram
which is not a rectangle? Explain.

\vspace{3cm}

{\bf 6.}  Suppose we have a viewport defined by the lower-left
point ${\bf l}=[10,10]^{\rm T}$, width 20 and height 10.  Given
the point $[0,0]^{\rm T}$ in 2D NDC coordinates, what is the
corresponding point in the viewport? Recall that NDC coordinates
live in the range [-1,1] in each coordinate.

\vspace{4cm}

{\bf 7.} Explain the concept of a $z-$buffer.

\vfill \eject

{\bf 8.} Sketch an arbitrary 2D triangle and mark its vertices as
$\pp_1, \pp_2, \pp_3$. Any point in the triangle has barycentric
coordinates $(u,v,w)$. Mark all points with $u=w$.

\vspace{4cm}

{\bf 9.} Sketch the elements of the OpenGL camera model (i.e., the
input parameters to {\tt gluLookAt}).

\vspace{4cm}

{\bf 10.} Circle the set of transformations which maps the light
triangle to the dark triangle. The marked point is assumed to have
coordinates $[50,50]$.

\begin{figure}[h]
    \epsfig{file=flip_tri.ps,height=1in}
\end{figure}


A) ~~Translate(-50,-50), Reflect about x, Translate(50,50)\\
 B)~~ Translate(-50,-50), Rotate 180, Translate(50,50)\\
 C)~~ Translate(-50,-50), Reflect about y, Translate(50,50)\\
 D)~~ Translate(50,50), Shear -20 in y, Translate(-50,-50)\\
 E)~~ None of the above

 {\bf 11.} Let $R$ be a rotation matrix and let $\pp$ be a point.
 For a point $\xx$, give the equation which rotates $\xx$ around
 $\pp$, using the matrix $R$.

 \vfill \eject

 {\bf 12.}  Suppose {\tt Square()} draws a unit square in the $z=0$ plane,
 centered at the origin.   Sketch what will be displayed as the result
  of the following OpenGL pseudo-code.

\begin{verbatim}
…   glTranslatef(2, 0, 0);
    glRotatef(45, 0, 0, 1);
  Square();
\end{verbatim}
  \vspace{4cm}

  {\bf 13.} Let the homogeneous coordinates of a point be given by
  $[2,-2,-2,2]^{\rm T}$. What are its affine coordinates?

  \vspace{1cm}

  {\bf 14.}Suppose you want to use the function
  \begin{center}{\tt
  gluPerspective(fieldofview,aspect,znear,zfar)}
  \end{center} to make your
  object appear smaller. Which parameter do you need to change and
  how?





















 \end{document}
