CG Lecture 7, Wed 2016-09-14

#. DreamWorks Animation is coming to RPI! For more information on areas that you may want to be considered for and detailed instructions on how to apply, follow the link to the Rensselaer Polytechnic Recruiting Event on our career page: Rensselaer Polytechnic On-campus DreamWorks Recruiting Event Fall 2016.

  1. How to print info from inside your javascript program.

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

    2. Reference:

    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.

  2. Powerful file editing: In class on Monday I used emacs to convert a chunk of ncc1701b.txt from a list of floats to legal javascript code to initialize an array of points. To efficiently program, you need to know some such tool. It doesn't have to be emacs, but I find emacs powerful.

  3. More iclicker questions.

  4. SIGGRAPH 2016 – Emerging Technologies Trailer.

  5. Homework 3 is online; due next Thurs 9am.

  6. 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').
  7. Full Tour of Disney Pixar Animation Studios!!

  8. The next few lectures will be mostly mathematics. I'm replacing the Angel lecture at Incremental and Quaternion Rotation, my own material. Feel free to read ahead.