CG Class 12, Mon 2017-10-02

1   Quaternions

My note on quaternions. This is an alternative method to rotate in 3D. Its advantages are:

  1. It starts from the intuitive axis-angle API.
  2. Animating a large rotation in small steps (by varying the angle slowly) is easy. In contrast, stepping the 3 Euler angles does not work well, and there's no obvious way to gradually apply a \(3\times3\) rotation matrix, \(M\). (You could compute \(M^{1/100}\) and apply it 100 times, but that computation is messy. Eigenvectors are useful here.)
  3. When combining multiple rotations, the axis and angle of the combo is easy to find.
  4. Having only 4 parameters to represent the 3 degrees of freedom of a 3D rotation is the right number. Using only 3 parameters, as Euler angles do, causes gimbal lock. That is, you cannot always represent a smooth rotation by smooth changes of the 3 parameters. OTOH, using 9 parameters, as with a matrix, gives too much opportunity for roundoff errors causing the matrix not to be exactly a rotation. (You can snap the matrix back to a rotation matrix, but that's messy.)

3   Shadertoy

Here is the link to Shadertoy.com. The co-creator of the website has an account named "iq", searching for that account brings up some renders that really push Webgl to its limits in really pretty ways (he used to work for Pixar and Siggraph) - Seretsi Khabane Lekena '17.

You'll have to run these yourself. The old laptop that I bring to class has only integrated graphics.

5   Handwritten notes from class

System Message: WARNING/2 (<string>, line 38); backlink

Duplicate explicit target name: "here".

Here.