Skip to main content

Solution ECSE-4750 Computer Graphics CG class 16 and Midterm, RPI, Thurs 2019-10-17

Name, RCSID: WRF Solution

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 25 questions. Check that your copy of this test has all six 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) If you had 1,000,000 vertices and wanted to change all the vertex positions by multiplying each x-coordinate by the same vertex's y-coordinate, the fastest place to do it is:

    1. with a javascript function
    2. in the vertex shader
    3. in the fragment shader
    4. in the html file
    5. it can't be done.
  2. (2 pts) Color printing on a sheet of paper exemplifies

    1. additive color
    2. subtractive color
    3. multiplicative color
    4. divisive color
    5. exponential color
  3. (2 pts) Major components of the WebGl model as discussed in class are:

    1. Objects, viewer, light sources, planets, material attributes.
    2. Still cameras, video cameras, objects, light sources.
    3. Objects, viewer, light sources, material attributes.
    4. Colored objects, black and white objects, white lights, colored lights
    5. Flat objects, curved objects, near lights, distant lights.
  4. (2 pts) In the graphics pipeline, the step after rasterizing is the

    1. vertex shader
    2. primitive assembler
    3. fragment shader
    4. tesselation shader
    5. javascript callback
  5. (2 pts) Double buffering solves which problem:

    1. producing stereo images
    2. low memory bandwidth
    3. remote debugging PCs
    4. displaying from a frame buffer while it's being updated
    5. optimizing scheduling two elevators as a group
  6. (2 pts) What does this line do:

    gl.bindBuffer( gl.ARRAY_BUFFER, vBuffer );
    
    1. Create this buffer.
    2. Enable this buffer so that the shaders will use it.
    3. Get the address of variable vBuffer.
    4. Prevent this buffer from being modified.
    5. Specify that this buffer will be the object of future buffer operations.
  7. (2 pts) Which of these curved surface equation types makes it easy to generate points on the surface?

    1. explicit
    2. explicit and implicit
    3. explicit and parametric
    4. implicit
    5. parametric
  8. (2 pts) How do you draw a pentagon in WebGL?

    1. Split it into triangles.
    2. Split it into triangles if it is concave, otherwise draw it directly.
    3. Split it into triangles if it is convex, otherwise draw it directly.
    4. Draw it directly.
    5. Split it into hexagons.
  9. (2 pts) In the WebGL pipeline, the Primitive Assembler does what?

    1. fits together pieces of ancient Sumerian pottery.
    2. rotates vertices as their coordinate systems change.
    3. creates lines and polygons from vertices.
    4. finds the pixels for each polygon.
    5. reports whether the keyboard and mouse are plugged in correctly.
  10. (2 pts) If you do not tell WebGL to do hidden surface removal, and two objects overlap the same pixel, then what color is that pixel?

    1. WebGL throws an error.
    2. the closer object
    3. the farther object
    4. the first object to be drawn there
    5. the last object to be drawn there
  11. (2 pts) This 3D homogeneous point: (4,3,2,1) corresponds to what Cartesian point:

    1. (4,3,2,1)
    2. (4,3,2)
    3. (3,2,1)
    4. (3/4, 1/2, 1/4)
    5. Some point at infinity.
  12. (2 pts) Consider an axis a=(0,1,0) and a point p=(2,3,4). What is the component of p that is perpendicular to a?

    1. (2,3,4)
    2. (2,0,4)
    3. (0,3,4)
    4. (0, 3/5, 4/5)
    5. (1,0,0)
  13. (2 pts) These next few questions are for 2D geometry. What is the 3x3 homogeneous matrix for the perspective projection whose center is at Cartesian (0,0) and whose viewplane is z=2?

    Cart: x' = 2x/z, z'=2. Hom: x'=2x, z=2z, w'=z.

    \(\begin{pmatrix} 2&0&0 \\ 0&2&0\\ 0&1&0 \end{pmatrix}\)

  14. (2 pts) What is the 3x3 homogeneous matrix for the parallel projection whose center is at Cartesian (0,0) and whose viewplane is z=2?

    Cart: x' = x, z'=2. Hom: x'=x, z=2w, w'=w.

    \(\begin{pmatrix} 1&0&0 \\ 0&0&2\\ 0&0&1 \end{pmatrix}\)

  15. (2 pts) When rotating an object, what can happen to an object?

    1. Straight lines might turn into curves.
    2. Straight lines stay straight, but angles might change.
    3. Straight lines stay straight, and angles don't change, but distances may change, either longer or shorter.
    4. Straight lines stay straight, and angles don't change, but distances might get longer.
    5. Straight lines stay straight, and angles and distances don't change.
  16. (2 pts) Translating the 2D homogeneous point by (2,3,4) by (in Cartesian terms) dx=1, dy=2 gives which new homogeneous point?

    1. (2,3,4)
    2. (1,2,3,4)
    3. (3,5)
    4. (6,11,4)
    5. (3,5,4)
  17. (2 pts) Rotating the 2D Cartesian point (0,-1) by \(90^o\) gives what:

    1. (1,0)
    2. (-1,0)
    3. (0,1)
    4. (0,-1)
    5. (-.7,.7)
  18. (2 pts) If a 3x3 rotation matrix has eigenvalues \(1, -\frac{1}{2}+\frac{\sqrt{3}}{2}i, -\frac{1}{2}-\frac{\sqrt{3}}{2}i\), then what is the rotation angle (in degrees)?

    Answer \(\cos\theta = -1/2\) so angle = 120 degrees.

  19. (2 pts) Give me a matrix M that has this property: for all vectors p, \(Mp = \begin{pmatrix}2 \\ 1 \\ 0\end{pmatrix} \times p\).

    Answer \(\begin{pmatrix} 0&0&1 \\ 0&0&-2 \\ -1&2&0 \end{pmatrix}\)

  20. (2 pts) What is the angle (in degrees) between these two vectors: (1,2,3), (2,4,6)?

    0

  21. (2 pts) This is a homogeneous 3D translation matrix: \(\begin{pmatrix} 3&0&0&2\\ 0&3&0&3\\ 0&0&3&4\\ 0&0&0&3 \end{pmatrix}\) Where is the Cartesian point (0,0,0) translated to? Give your result as a Cartesian point.

    One way is to divide the whole matrix by 3, which doesn't change its effect. Then you can read the translation off the right column: (2/3, 1, 4/3). So (0,0,0) translates to (2/3, 1, 4/3).

  22. (2 pts) What is the purpose of v1 in this line of code?

    var v2 = gl.getAttribLocation( program, "v1" );

    It's the name of an attribute variable in a shader.

  23. (2 pts) You're mixing 3 pure spectral colors: 20% of a color with wavelength 500nm, 40% of 600nm and 40% of 700nm. The result will appear to be one color. What diagram would you use to compute what color this mix would appear to be, to a normal person?

    CIE chromaticity diagram

  24. (2 pts) If i and j are quaternions, what is ij+ji?

    k-k = 0

  25. (2 pts) The quaternion k represents what rotation? Give the axis and angle.

    180 degrees (pi radians) about the z axis

End of midterm