CG Class 7, Mon 2017-09-18

2   This Wed

  1. No prepared lectures.
  2. The TAs will be present to help, e.g., with the homework.

3   SIGGRAPH 2017 videos

SIGGRAPH is the world's leading CG conference. I'll show various videos from it.

  1. BendSketch: Modeling Freeform Surfaces Through 2D Sketching.

4   How to print info from inside your javascript program

  1. There are several ways; here is the easiest.

  2. Reference: http://www.w3schools.com/js/js_output.asp

  3. Examples to do inside square.js:

    1. window.alert('this is an alert');
    2. window.alert('vertices length: ' + vertices.length + ' 1: ' + vertices[1]);
  4. Note that you can write variable values as well as strings.

  5. Another way is to write to the console log thus:

    console.log('this is a log message');

  6. In firefox, you can display the log window with F12.

  7. An advantage of the log is that you see all the messages together.

  8. I'll demo these methods.

5   Today's demo program

For today's demo program, I'll modify triangle to add a slider that controls the amount of green to add to the triangle color.

  1. The amount of green will be read from a slider.
  2. Scrounge your slider code from gasket5.
  3. The value will be transmitted to the fragment shader in a uniform variable.
  4. Scrounge around in Angel's examples to see how to use a uniform variable. (I grepped for 'uniform').

6   Slides

We'll continue with the textbook powerpoint slides.

  1. 3_3, Programming with WebGL Part 4: Color and Attributes
  2. 3_4, Programming with WebGL Part 5: More GLSL
  3. 3_5, Programming with WebGL Part 6: Three Dimensions

7   Next few lectures will be mostly mathematics

I'm replacing the Angel lecture at Incremental and Quaternion Rotation, with my own material. Feel free to read ahead.

8   Homework 3 online

  1. Homework 3 is online; due next Mon 2359.