## ECSE-4750 Computer Graphics, Rensselaer Polytechnic Institute, Final Exam, Fall 2010, 15 Dec 2010 6:30 - 9:30pm, DCC330




NAME: ____ Solution
Subtotal of questions 1-10:_______, q 11-25:______, q 26-36:______, TOTAL: ______

Answer every question.There are 7 pages with 36 questions. Each question is worth 1 point.

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.

⇒You may write FREE as the correct answer to any five questions.⇐

1. ____ Consider a 3D triangle with vertices (0,0,0), (10,0,10), (0,10,0). What is the z value of the point in the triangle with x=3, y=1?
The triangle's equation is z=x, so the answer is z=3.
2. ____ The following can not possibly be a 3D Cartesian rotation matrix because the 2nd column's length is not one:
{$\begin{pmatrix} 1&1&0\\0&1&0\\0&-1&1\end{pmatrix}$}
Justify, i.e., explain the reason for, this rule.
The 2nd column is what the rotation does to (0,1,0). Since rotations don't change lengths, the length of the 2nd column, considered as a vector must be 1.
3. ____ If a=(7,9,6) then write {$(a\times p)\, a$} as a matrix M, depending only on {$a$}, times {$p$}.
{$\begin{pmatrix} 0&-6&9\\6&0&-7\\-9&7&0\end{pmatrix}$}
4. ____ What is the 4x4 homogeneous matrix for
1. a 3D rotation by 45 degrees about the Y axis,
2. followed by this translation: x'=x, y'=y+1, z'=z-2.
{$\begin{pmatrix} .7&0&.7&0\\0&1&0&1\\-.7&0&.7&-2\\0&0&0&1 \end{pmatrix}$} You have to give one matrix with all numbers. Other close approximations to the sin and cos are ok. (Rotations about the Y-axis are tricky. WRF got this one wrong.)
5. ______ Can the volume of a small cube change when its vertices are rotated? (yes or no).
No. Rotations don't change lengths and so don't change volumes.
6. ______ Give the quaternion for a 360 degree rotation about the axis (.6,0,.8).
Either q=1 or q=-1. They both have the same effect when you apply {$p'=qpq^*$}. You would get q=1 by noticing that 360 degrees means the identity, or get q=-1 by applying the formula for computing q from the axis and angle.
7. _____ What is one problem with interpolating a spline through the control points instead of approximating a spline near the points?
The curve will have to swing wide outside the control polygon.
8. _____ Does projection preserve straight lines? Justify your answer.
Yes, look at it this way. If you're projecting a (straight) line L from some center of projection (COP) onto a projection plane, then the COP and L define a plane. That plane intersects the projection plane in a straight line. That line is the projection of L.
9. _____ Does projection preserve angles?
No. For example, a circle might project to an ellipse.
10. ______ What advantage do cubic splines have over quadratic splines?
You can match the radius of curvature of the two segments at a joint. This makes the joint more invisible, which is desirable.
11. ____ Name the effect which accentuates the visibility of the common edge between two adjacent bands of slightly different brightness.
Mach band.
12. ____ High spatial frequencies can be bad. Name the technique used to remove them.
anti-aliasing.
13. ____ Which shader is executed first in the graphics pipeline: vertex or fragment?
vertex.
14. ____ One way to shade a polygon with many edges is:
1. split it into triangles, then
2. shade the triangles.
If you use this to make a video, then each separate frame may look good, but the video may look bad. Why?
As the polygon rotates and moves from frame to frame, it might be triangulated differently. When a polygon is triangulated differently, it will probably be shaded differently. Therefore each separate frame may look good, the shading will be inconsistent from frame to frame, which will look bad.
15. ____ 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.
texture coordinates, normals, colors.
16. ____ Compare Gouraud and Phong shading: Which one is more realistic, especially for highly curved surfaces?
Phong.
17. ____ Why?
Because only it can generate a highlight in the middle of a polygon.
18. ____ Where in the graphics pipeline does texture mapping take place?
Fragment shader.
19. ______ Are vertices assembled into objects in the vertex shader, in the fragment shader, or somewhere else?
Rasterizer.
20. ______ Is fog generated the vertex shader, in the fragment shader, or somewhere else?
fragment shader.
21. ______ Clouds and crowds are examples of what type of system?
particle systems.
22. ______ A major rendering technique was invented by thinking how sunlight shines through a window and bounces around to illuminate the walls, ceiling, and floor of a room. Name that technique.
Radiosity; see the book page 324. Also, Wikipedia says, "Radiosity methods were first developed in about 1950 in the engineering field of heat transfer. They were later refined specifically for application to the problem of rendering computer graphics in 1984 by researchers at Cornell University". Ray tracing is wrong since it runs a line of sight from the viewer and renders only specular objects well, not things like walls, ceilings and floors.
23. ______ Since clipping to a clip region that is a cube is so easy, graphics systems tranform any scene with its clip window to make the clip window a cube. Name this transformation technique.
view normalization.
24. ____ Sometimes it's useful to imagine a bounding box around a face. Sometimes two faces' bounding boxes might overlap. IOW (in other words), the two faces overlap in X, overlap in Y, and also overlap in Z. This case causes problems for one common method of determining which face is in from of the other when rendering. Please tell me the name of this method.
painters algorithm.
25. _____ Draw an example where clipping a triangle causes it to have more vertices.
Figure shows a triangle with one vertex outside and two vertices inside the clip window. It gets clipped to a quadrilateral.
26. _____ Suppose that you have 12 triangles that can be arranged into a triangle strip. How many vertices would you have to specify to OpenGL if you use the fact that they can be arranged into a triangle strip.
3 vertices for the 1st triangle plus 1 vertex for each other triangle gives 14 vertices.
27. ____ Name the OpenGL technique that takes a texture map and creates a hierarchy of coarser and coarser versions of it.
Mipmapping.
28. ____ What problem of pixels and texels does that solve?
Their being different sizes. That always happens with perspective projections since the projected texel's size will depend on how far away it is.
29. ____ 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.
File I/O.
30. ____ 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.
31. _____ How do you specify a color to be 20% transparent?
That would be 80% opaque, so set A=0.8, e.g. (.3,.3,.3,.8).
32. ______ Is the following code a vertex shader or a fragment shader?
void main(void) { gl_FragColor = gl_FrontColor; }
Fragment shader.
33. ______ Do you set a texture coordinate thus
glTexCoord2f(s0, t0);
before or after the vertex it applies to?
Before.
34. ______ What is swizzling?
In GLSL, working with any subset of the elements of a vector, in any order, in 1 cycle. E.g., v.xyz = v.xyz / v.w
35. _____Can the standard OpenGL pipeline easily handle light scattering from object to object? Why (not)?
No since it processes objects independently of each other.
36. _____ Why would you want to write code to write an image in the PPM format (instead of writing code to write it in, say, JPEG)?
The PPM file format is very simple, so it's easy to write code to write it.

END