Computer Graphics Intro March 8, 2005 G. Farin Name:

ASU ID:

Midterm

1. Let a 4 × 4 matrix be given by

[\begin{matrix}2 & 0 & 0 & 2 \\ 0 & 2 & 0 & 2 \\ 0 & 0 & 2 & 2 \\ 0 & 0 & 0 & 1 \end{matrix}] .

When interpreted as an affine map, what is the action of this matrix?

2. Let a 3D (oriented) triangle be given by the vertices

p_{1} = [\begin{matrix}1 \\ 0 \\ 0 \end{matrix}] , p_{2} = [\begin{matrix}0 \\ 6 \\ 0 \end{matrix}] , p_{3} = [\begin{matrix}0 \\ 0 \\ 1 \end{matrix}] ,

Find the normalized normal to this triangle.

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

4. What is a viewing frustum? Draw a 2D sketch and label it.

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

6. Suppose we have a viewport defined by the lower-left point l = [10, 10]^{T}, width 20 and height 10. Given the point [0, 0]^{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.

7. Explain the concept of a z−buffer.

8. Sketch an arbitrary 2D triangle and mark its vertices as p_{1}, p_{2}, p_{3}. Any point in the triangle has barycentric coordinates (u, v, w). Mark all points with u = w.

9. Sketch the elements of the OpenGL camera model (i.e., the input param-

eters to gluLookAt).

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].

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

11. Let R be a rotation matrix and let p be a point. For a point x, give the equation which rotates x around p, using the matrix R.

12. Suppose 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.

   glTranslatef(2, 0, 0);
    glRotatef(45, 0, 0, 1);
  Square();

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

14.Suppose you want to use the function

         gluPerspective(fieldofview,aspect,znear,zfar)

to make your object appear smaller. Which parameter do you need to change and how?