Skip to main content

CG Class 10, Mon 2019-09-23

1   Today's iclicker questions

  1. Bump mapping is
    1. more realistic than actually 3D modeling each bump
    2. faster than actually 3D modeling each bump
    3. both
    4. neither
    5. unrelated to modeling bumps; the name is coincidental.
  2. 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.
  3. 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.
  4. 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.
  5. To draw into only part of the graphics window you would call:
    1. gl.drawpart
    2. gl_Position
    3. gl.viewport
    4. gl.window
    5. There's no builtin routine; you have to scale your graphics yourself to achieve this.
  6. What buffer is used by WebGl to do hidden surface removal?
  1. Closest object buffer
  2. Color buffer
  3. Depth or Z buffer
  4. Hidden-surface buffer
  5. Ray-trace buffer
  1. 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
  2. gasket2 has this code: var points=[ ]; ... points.push(a,b,c); What does push do here?
    1. Appends new entries to the end of points.
    2. Inserts new entries at the start of points.
    3. Overwrites the first entries of points.
    4. Overwrites the last entries of points.
    5. Throws an error because we didn't specify a size for points.
  3. Why would you want to send a variable to a vertex shader that has the same value for every vertex?
    1. the vertex's coordinates
    2. the vertex's color
    3. the object's global orientation
    4. the location of the global light source
    5. C and D.
  4. How would you send that variable to the vertex shader?
    1. as a varying variable.
    2. as a uniform variable.
    3. in another array similar to the vertex array.
    4. with a bindBuffer call.
    5. with a bufferData call.
  5. You call gl.BufferSubData to do what?
    1. to add or replace part of the buffer in the GPU.
    2. to define a submarine object.
    3. to subtract some data in the buffer.
    4. to tell the GPU to look for a pattern and substitute any occurrences,
    5. to tell the GPU to use a subroutine instead of the main program.

4   3D rotation

IMNSHO I do this topic better than the textbook.

My note on 3D rotation.