## ECSE-4750 Computer Graphics, Rensselaer Polytechnic Institute, Final Exam (v2), Fall 2011, 15 Dec 2011 3-6pm, DCC330







EMAIL:______________________________________________ RIN:_________________________________

Subtotal of questions 1-8:_______________, q 9-17:____________, q 18-25:____________, TOTAL: ______________

Answer every question.There are 6 pages with 25 questions. Each question is worth 4 points.

This exam is open book: you may use calculators and any paper books and notes that you brought with you. You may not use computers or communication devices, or share material with other students.

1. ________ Consider a 3D triangle with vertices (0,0,0), (5,0,10), (0,20,0). What is the z value of the point in the triangle with x=3, y=1?
The question is, what linear combo of the 3 vertices matches the x and y components of (3,1,z)? (3,1) = .6 (5,0) + .05 (0,20). So the answer is z= .6x10+.5x0 = 6.
2. ________ Why can the following not possibly be a 3D Cartesian rotation matrix? {$\begin{pmatrix} 1& 0 &0\\1 & 0 &0\\0& 0 &1\end{pmatrix}$}
column 2 doesn't have length =1. Various other reasons are also ok.
3. ________ If a=(4,3,5) then write {$(a\cdot p)\, a$} as a matrix M, depending only on {$a$}, times {$p$}.
{$$M = \left(\begin{array}{ccc} 16 & 12 & 20 \\ 12 & 9 & 15\\ 20 & 15 & 25 \end{array} \right).$$}
{$$p' = M p$$}
4. ________ What is the 4x4 homogeneous matrix for a 3D rotation by 90 degrees about the X axis, followed by this translation: x'=x-1, y'=y+1, z'=z+2.
{$$M = \left(\begin{array}{rrrr} 1 & 0 & 0 & -1\\ 0 & 0 & -1 & 1\\ 0 & 1 & 0 & 2\\ 0 & 0 & 0 & 1\end{array} \right)$$}
5. ________ Write the vector formula for the 3D rotation by 60 degrees about the Y axis.
{$$p' = \frac{1}{2} \left(p + ((1,0,0)\cdot p)\, (1,0,0) \right) + \frac{\sqrt{3}}{2} (1,0,0)\times p$$}
That can be written various equivalent ways.
6. ______ Write the quaternion for the 3D rotation by 60 degrees about the Y axis.
{$$q = \frac{\sqrt{3}}{2} + \frac{1}{2} j$$}
7. ________ What is one problem with interpolating a spline through the control points instead of approximating a spline near the points?
The curve will swing outside the convex hull of the control points, by an amount that is not intuitive. If the control points are almost collinear, the curve might not be. IOW, it's harder to predict the curve from the control points.
You can match the curve sections with their first two derivatives and the joint, making the joint generally invisible.
9. ________ What technique computes the surroundings visible as a reflected image in a shiny object?
environment mapping
10. ________ When projected objects are less than one pixel large, there is a lot of fictitious high frequency clutter in the image. Name the technique used to fix this.
anti-aliasing
11. ________ In the graphics pipeline, does the rasterizer send its output to the vertex or fragment shader? (Pick one, or pick both.)
12. ________ In the graphics pipeline, when a triangle is processed, the (x,y,z) coordinates of the vertices are interpolated across the whole triangle to give the coordinates of each fragment. Name two other things that may commonly be specified at the vertices and then interpolated across the triangle to give a value for each fragment.
colors, normals.
13. ________ Where in the graphics pipeline does texture mapping take place?
14. ________ When clipping in 3D, how many independent clippers are required in the pipeline?
6 .
15. ______ Do a view normalization of this square A(3,3), B(3,4), C(4,4), D(4,3) that is being viewed from (0,0) and projected into the plane x=1. The transformed square, when seen with a parallel projection from x= -infinity should look the same as the original square when seen in perspective from (0,0). That is, write the transformed coordinates for ABCD. Also, draw a figure showing the projection.
See the figures in Gfiles:final-v2-ans-figs.pdf.
16. ______ Are vertices assembled into objects in the vertex shader, in the fragment shader, or in the rasterizer?
rasterizer.
17. ________ Draw an example where clipping a polygon causes it to split into two pieces (connected by edges running along the edge of the clip window).
See the figures.
18. ________ Draw 1/8 of a circle of radius R=12 using the Bresenham method. Show your work.
See the figures.
19. ________ Following the principle that less is more, the OpenGL designers decided not to include some functionality that a program that processes images would probably need. Name it.
20. ________ When compositing several images, the limited precision of the color (frame) buffers may hurt the image quality. Therefore, OpenGL also has another buffer to composit into. Name it.
Accumulation buffer.
21. ______ Is the following code a vertex shader or a fragment shader?  void main(void) { gl_FragColor = gl_FrontColor;}
22. ______ Do you set a texture coordinate thus glTexCoord2f(s0, t0); before or after the vertex it applies to?
Before.
23. _______ Can the standard OpenGL pipeline easily handle light scattering from object to object? Why (not)?
No, because it processes vertices independently, often in separate graphics cores, and they cannot easily interact with each other.
     // diffuse.fs: per-pixel diffuse lighting
varying vec3 N, L;
void main(void)
{    // output the diffuse color
float intensity = max(0.0,
dot(normalize(N), normalize(L)));
gl_FragColor = gl_Color;
gl_FragColor.rgb *= intensity;  }


24. ______ Where do the variables N and L get their values from?
Computed by the rasterizer (from per-vertex values supplied by the vertex shader).
25. _______ What uses the value of the variable gl_FragColor?
It becomes the color of the pixel, if this fragment passes other tests like the depth buffer.

END