Skip to main content

CG Class 9, Thurs 2019-09-19

1   Today's iclicker questions

  1. 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.
  2. What does this line do:

    var vBuffer = gl.createBuffer();
    
    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.
  3. How does gl.drawArrays know when the vertices it's drawing in 3D?

    1. It's specified as one of the arguments in gl.drawArrays.
    2. It's specified as one of the arguments in gl.bufferData.
    3. It's specified as one of the arguments in gl.vertexAttribPointer.
    4. It's specified as one of the arguments in gl.getAttribLocation.
    5. It's specified as one of the arguments in gl.enableVertexAttribArray.
  4. How does gl.drawArrays know when the color values are floats instead of ints?

    1. It's specified as one of the arguments in gl.drawArrays.
    2. It's specified as one of the arguments in gl.bufferData.
    3. It's specified as one of the arguments in gl.vertexAttribPointer.
    4. It's specified as one of the arguments in gl.getAttribLocation.
    5. It's specified as one of the arguments in gl.enableVertexAttribArray.
  5. How does gl.drawArrays know how many triangles are in a triangle strip?

    1. It's specified as one of the arguments in gl.drawArrays.
    2. It's specified as one of the arguments in gl.bufferData.
    3. It's specified as one of the arguments in gl.vertexAttribPointer.
    4. It's specified as one of the arguments in gl.getAttribLocation.
    5. It's specified as one of the arguments in gl.enableVertexAttribArray.
  6. Normalize this vector: (8,-6,0).

    1. (3, 4, 5).
    2. (3/5, -4/5, 0).
    3. (4/5, -3/5, 0).
    4. (4/5, 3/5, 0).
    5. (8, -6, 10).
  7. Find a normal vector to the plane through the points (1,0,0), (1,1,0), (1,0,1).

    1. (0, -1, 0)
    2. (0, 1, 0)
    3. (1, 0, 0)
    4. (1, 1, 0)
    5. (3, 2, 2)
  8. 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
  9. Which of these curved surface equation types makes it easy to test whether a point is on the surface?

    1. explicit
    2. explicit and implicit
    3. explicit and parametric
    4. implicit
    5. parametric
  10. What type of equation is this: \(x^2+y^2+z^2=1\)

    1. explicit
    2. explicit and implicit
    3. explicit and parametric
    4. implicit
    5. parametric

2   Homogeneous coordinates

My take on homogeneous coordinates. IMNSHO (In My Not So Humble Opinion) it's better than the book.

3   Textbook slides: Chapter 5

The big topic for Chapter 5 is homogeneous coordinates. They allow all the common transformations - translation, rotation, scaling, projection - to be expressed as a multiplication by a 4x4 matrix.

  1. 5_1 Representation - I'll do this really quickly.

4   Textbook programs

My local web copy .

My copy on RCS.

  1. Chapter 4:

    1. color interpolation
    2. element arrays
    3. etc

    We'll skip quaternions until we see 3D rotations.