CG Class 5, Wed 2017-09-13

2   Protecting your website

  1. By default, everything on https://www.rpi.edu/~RCSID/ is readable by anyone.
  2. Here's one way to add a low grade password.
  3. It relies on the facts that when a reader navigates to a directory.
    1. by default, the contents of the directory are listed, unless
    2. the dir contains the file index.html (or variants like index.htm).
    3. then that file is displayed instead of the directory contents.
    4. This behavior is controlled by various options in files like .htaccess, so there might be dirs where it doesn't happen.
    5. Nevertheless, except for that unusual case, the reader can't see the actual directory.
    6. However, any file (or subdir) that the reader knows about can be listed explicitly.
  4. So, do this:
    1. Create an empty file public_html/index.html
    2. Create a subdir with an unguessable name, like public_html/passw0rd/.
    3. Put your work in there.
    4. Its URL will be https://www.rpi.edu/~RCSID/passw0rd/
  5. There are also other harder ways to add passwords to directories.

3   Last year's course

If you're interested, the Fall 2016 version of this course is here. This year is 90% the same.

4   Linear algebra tutorial

  1. For students confused by the linear algebra questions on homework 1, the following may help:

    1. vector methods.
    2. Vector Math for 3D Computer Graphics
    3. Working with vectors, from Maths: A Student's Survival Guide
  2. Also see wikipedia.

  3. Some older graphics texts have appendices summarizing the relevant linear algebra.

  4. The scalar (dot) product is needed to do things like this:

    1. compute how a ball bounces off a wall in pong
    2. compute lighting effects (how light reflects from a surface)
  5. The cross product's applications include:

    1. compute torque and angular momentum.
    2. compute the area of a parallelogram.

    It is the only operator that you'll probably ever see that is not associative. Ax(BxC) != (AxB)xC.

  6. The triple product (A.BxC) computes the volume of a parallelepiped.

5   Programming

  1. Serpinski gasket programs showing more complicated WebGL.

    We play with the code to see what changes.

  2. Notes from yesterday:

    1. gasket4 shows how to do 3D with a depth buffer.

      Each pixel now stores

      1. RGB color of the object that was drawn at that pixel
      2. distance (depth) to that object.

      When a new object is drawn over that pixel, it replaces old color and depth only if the new object is closer. So, close objects hide distance objects.

      We'll ignore the problem of an object that covers only part of the pixel.

    2. gasket5 shows an interactive program with a slider and callback. The user changing the slider causes a javascript function to be called.

  3. Graphics display hardware: The progress of Computer Graphics is largely the progress of hardware. We'll see more of this later. However, here's an intro.

    1. What physical principles are each type of HARDWARE based on?

      1. CRT: certain rare earth materials emit photons when hit by electrons. Explaining this is what got Einstein his Nobel (not relativity).
      2. LCD: electric field causes big asymmetric molecules to untwist so that they no longer rotate polarized light passing through them.
    2. What engineering challenges required solving?

      1. Shadow-mask CRT: electron beams travel varying distances at different angles, but don't hit the wrong phosphor even as the system gets hotter. The precision is 0.1%.
      2. Hi-performance graphics requires hi bandwidth memory.
      3. Virtual reality headsets require knowing where your head is and its angle (harder).

      Think of 3 ways to do this.

    3. What tech advances enabled the solutions?

      1. Raster graphics requires cheap memory.
      2. LCD panels require large arrays of transistors.
  4. Note on Engineering Grounded In Reality and famous graphics alumni.

  5. Executive summary of Portability And Standards.

6   Homeworks

  1. Homework 2 is really due next Mon Sep 18 2359.
  2. You may do web exercises on any computer; RCS is not required.
  3. Instead of putting your files on afs, it's ok to submit a zipped file, containing your .js and .html files and the utility files needed to run it. It must be organized so that if we unzip into a random location and point the browser at the .html file, then it will work.