CG ECSE-4750 Computer Graphics Midterm, RPI, Thurs 2018-10-11

Name, RCSID:

.

.

Rules:

  1. You have 80 minutes.
  2. You may bring in one 2-sided 8.5"x11" paper with notes.
  3. You may not share material with each other during the exam.
  4. No collaboration or communication (except with the staff) is allowed.
  5. There are 20 questions. Check that your copy of this test has all seven pages.
  6. If you need more space, use the back of another page, and write a note in the original space to tell us.
  1. (2 pts) Suppose that you want to skew an object by adding each vertex's x-coordinate to the same vertex's y-coordinate. Where is the best place to do it?

    .
    
    
    
    
    .
    
  2. (2 pts) List the four components of the graphics pipeline in the correct order.

    .
    
    
    
    
    
    
    .
    
  3. (2 pts) What is the best type of variable for the location of a global light source in the vertex shader?

    .
    
    
    
    .
    
  4. (2 pts) If M is a 3D Cartesian rotation matrix, what property must the columns have?

    .
    
    
    
    
    
    .
    
  5. (2 pts) Name the 2 types of shaders that every WebGL program must have.

    .
    
    
    
    
    
    .
    
  6. (2 pts) What is the purpose of gl-canvas in this line of code:

    canvas = document.getElementById( "gl-canvas" );

    .
    
    
    
    
    
    
    
    
    .
    
  7. (2 pts) What does this line of code do:

    gl.viewport( 0, 0, canvas.width, canvas.height );

    .
    
    
    
    
    
    
    
    
    .
    
  8. (2 pts) What is the purpose of vPosition in this line of code?

    var vPosition = gl.getAttribLocation( program, "vPosition" );

    .
    
    
    
    
    
    
    
    
    .
    
  9. (2 pts) Suppose that your vertex shader computed some property of each vertex and you want the rasterizer to compute a weighted value of that property for each fragment. What type of variable would your vertex shader store that property in?

    .
    
    
    
    
    
    
    
    
    .
    
  10. (2 pts) Consider an axis a=(1,0,0) and a point p=(2,4,3). What is the component of p that is perpendicular to a?

    .
    
    
    
    
    
    
    
    
    .
    
  11. (2 pts) What Cartesian point corresponds to this 3D homogeneous point: (10, 9, 8, 7)?

    .
    
    
    
    
    
    
    
    
    .
    
  12. (2 pts) This question is for 2D geometry. What is the homogeneous matrix for the perspective projection whose center is at Cartesian (0,0) and whose viewplane is x=2?

    .
    
    
    
    
    
    
    
    
    .
    
  13. Of the explicit, parametric, and implicit curved surface equation types, which one or more makes it easy to test whether a given point is on the surface?

    .
    
    
    
    
    
    
    
    
    .
    
  14. (2 pts) Why does WebGL have the triangle-strip object type, in addition to the triangle type?

    .
    
    
    
    
    
    
    
    
    .
    
  15. (2 pts) In the WebGL pipeline, the Primitive Assembler does what?

    .
    
    
    
    
    
    
    
    
    .
    
  16. (2 pts) You call gl.BufferSubData to do what?

    .
    
    
    
    
    
    
    
    
    .
    
  17. (2 pts) What tool maps spectral colors into a human perceptual coordinate system? Use it to determine what one color a mixture of colors will appear to be. The curve of pure spectral colors was determined experimentally.

    .
    
    
    
    
    
    
    
    
    .
    
  18. (2 pts) What is the volume of a parallelepiped that starts at (0,0,0) and whose three edges starting from there are (1,0,0), (1,1,0), and (1,1,1)? It's ok to write the expression; no need to evaluate it.

    .
    
    
    
    
    
    
    
    
    .
    
  19. (2 pts) Write the transformation equations to make a rectangle from (0,0) to (2,3) fit into a square that from (0,0) to (1,1). Scale the rectangle uniformly and center it in the square.

    .
    
    
    
    
    
    
    
    
    .
    
  20. (2 pts) You see the expression flatten(points) often in Javascript programs. what does flatten do?

    .
    
    
    
    
    
    
    
    
    .
    

End of midterm