(toggle answers)
Name: _______________________________
Student ID: _______________________________

Total points: 70
  1. In your own words, compare the complementary fields of computer graphics and image analysis. [4]

    Synthesis vs. analysis: both are components of visual computing. Computer graphics starts with digital representations of objects (triangle meshes, lights, etc.) and produces images on screen. Image analysis starts with images (digital camera, satellite, MRI, etc.) and produces digital representations of the objects in the images.

  2. What is colour? Is an RGB triple (e.g., "#00FF77") a colour? Discuss. [4]

    Colour is a distribution of light energy across the visible spectrum ("frequency distribution"). An RGB triple is a point in a colour space, a combination of three chromaticities. Without specifying what those chromaticities are or how they are combined, an RGB triple is not a colour.

  3. Contrast the goals of off-line rendering vs. real-time graphics. Which is OpenGL generally used for? [5]

    Off-line rendering prioritizes photorealism and image quality over rendering time -- it's okay if each frame takes days to render, as long as it looks really good. Real-time graphics places a constraint of rendering time -- we still want it to look good, but not if that means our framerate drops below, say, 60 frames per second. OpenGL is generally used for real-time rendering.

  4. Describe the idea behind raytracing. In what ways does it produce superior images over standard OpenGL rendering? [5]

    To find a value for each pixel in the framebuffer, rays are cast from the center of projection through each pixel in the image plane and into the scene. When a ray intersects a surface, contributions from ambient/diffuse/specular lighting are taken. In addition, new rays are cast starting from that point in the direction of reflection (optionally, refraction, too). This proceeds recursively until rays exit the scene or hit a light. Standard OpenGL rendering does not model reflections or refractions.

  5. Contrast clipping with culling. Why are they important? [5]

    Clipping removes primitives which are outside the view frustum, the volume of space which is visible by the camera. Culling removes primitives which are not visible, even though they may be within the view frustum. For instance, back-face culling removes primitives that face away from the camera, which are generally not visible.

  6. Discuss what is meant by calling OpenGL a "state machine". [5]

    Most OpenGL commands modify the current state, e.g., the current model-view matrix, or the current material properties. When a primitive is added, e.g., a vertex of a polygon, that primitive takes on whatever OpenGL state that was current at the time. The impact on coding is that we need to specify all the properties for a vertex before its glVertex() call.

  7. Write a short C code snippet that draws a red triangle in OpenGL, with vertices at A = (0, 1, 2), B = (3, 1, 2), and C = (3, 1, 0) (in order). What is the outward-facing unit normal? [6]
    	glBegin( GL_TRIANGLES );
    	glColor3f ( 0.0, 1.0, 0.0 );
    	glVertex3f( 0.0, 0.0, 0.0 );
    	glVertex3f( 1.0, 0.0, 0.0 );
    	glVertex3f( 0.0, 1.0, 0.0 );
    The normal vector is (0, 1, 0), pointing in the positive y direction.

  8. The two most important transform matrices in OpenGL are the model-view matrix (glMatrixMode( GL_MODELVIEW )) and the projection matrix (glMatrixMode( GL_PROJECTION )). Contrast the roles of these two matrices. [5]

    The model-view matrix transforms from world coordinates to camera coordinates: it specifies the location of objects in the virtual world relative to the camera. It is also what we use to position objects relative to each other. The projection matrix transforms from camera coordinates to screen coordinates: it converts from 3D points to 2D points.

  9. What does it mean for a set of vectors to be linearly independent? [3]

    A set of vectors is linearly independent if no one vector in the set can be expressed as a linear combination of the other vectors. If we were to remove any vector from the set, then the vector space spanned by the set would collapse by a dimension.

  10. Which of the following sets of homogeneous coordinates represent the same geometric entity? Group together those which are the same: e.g., (a,b,c), (d,e) [4]
    a = [ 1, 3, 2, 1 ]T b = [ 1, 3, 2, 0 ]T c = [ 2, 6, 4, 0 ]T
    d = [ 2, 6, 4, 1 ]T e = [ 2, 6, 4, 2 ]T

    (a, e), b, c, d
  11. Create a 4x4 matrix M that first translates a point by a vector t = (tx, ty, tz), then scales the resulting point p by a vector s = (sx, sy, sz). For example, if p is the point (1, 0, 0), and the translation is t=(3, 0, 0), and the scaling is s=(2, 1, 1), then the transformed point p' should be (8, 0, 0). Assume p is a column vector in homogeneous coordinates, and the transformed point is p' = M p (left multiplication). [6]

    sx 0 0 sx tx
    0 sy 0 sy ty
    0 0 sz sz tz
    0 0 0 1

  12. Increasing the value for the GL_SHININESS parameter of a material will (circle all that apply): [3]
    1. Increase the ratio of specular to diffuse reflectivity
    2. Decrease the ratio of specular to diffuse reflectivity
    3. Increase the brightness of diffuse highlights
    4. Decrease the brightness of diffuse highlights
    5. Increase the size of specular highlights
    6. Decrease the size of specular highlights

    (f) Decrease the size of specular highlights (sharper falloff)
  13. Name and describe the four terms in the OpenGL local illumination model. For each term, list what vectors, if any, are required to compute the term. [5]
    • Ambient: uniform light that shines everywhere. No vectors needed.
    • Diffuse: light that shines on a dull, non-shiny object. Need normal vector and vector to the light source.
    • Specular: Highlights reflecting off a shiny object. Need view vector to camera and reflection vector.
    • Emissive: Simulates a glowing object. No vectors needed.

  14. What are OpenGL display lists? Why use them? Describe an example situation well-suited to display lists. [6]

    OpenGL display lists store a sequence of OpenGL commands (e.g., material definitions, lights, primitives, matrix transforms) that are then stored in graphics hardware memory. The display list can then be executed multiple times (perhaps with OpenGL state change in between) without resending the data to the hardware; this can potentially speed up the rendering. For instance if a scene is to have many hundreds of teapots, it would make sense to store the teapot vertex data in a display list.

  15. Contrast orthographic projection with perspective projection. [4]

    The projector lines in orthographic projection are all parallel, whereas the projector lines in perspective projection converge to a single point, the center of projection. Orthographic projection is equivalent to perspective projection with a center of projection infinitely far away. Perspective results in foreshortening: closer objects appear larger, farther objects appear smaller.