CG Class 7, Mon 2017-09-18
Table of contents
1 Serpinski gasket links fixed
- There were some obsolete and suboptimal links in class04 and 05 and the syllabus. I (think I've) fixed them now. Sorry.
- The gasket programs are here.
- My firefox has stopped running webgl. However chrome works.
2 This Wed
- No prepared lectures.
- 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.
4 How to print info from inside your javascript program
-
There are several ways; here is the easiest.
-
Reference: http://www.w3schools.com/js/js_output.asp
-
Examples to do inside square.js:
- window.alert('this is an alert');
- window.alert('vertices length: ' + vertices.length + ' 1: ' + vertices[1]);
-
Note that you can write variable values as well as strings.
-
Another way is to write to the console log thus:
console.log('this is a log message');
-
In firefox, you can display the log window with F12.
-
An advantage of the log is that you see all the messages together.
-
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.
- The amount of green will be read from a slider.
- Scrounge your slider code from gasket5.
- The value will be transmitted to the fragment shader in a uniform variable.
- 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.
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
- Homework 3 is online; due next Mon 2359.