Skip to main content

CG Class 4, Thu 2019-09-05

1   Iclicker starts Mon

Bring your iclickers.

2   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.

3   Protecting your RCS 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.

4   Your RCS web files not visible?

  1. Read this if, when you browse to your public_html, you see only subdirs, not plain files.
  2. The problem is an AFS Access Control List (ACL) setting on the dir.
  3. See them thus in an ssh session: fs la .
  4. system:anyuser needs to be rl, not l.
  5. Sometimes the defaults are changed w/o telling anyone.
  6. Set the ACL thus: fs sa . system:anyuser rl (note the period).
  7. New subdirs inherit from their parents, but ACL changes do not propagate.
  8. So, you need repeat that command in any subdirs you already created.

5   Programming

  1. Serpinski gasket programs showing more complicated WebGL.

    We play with the code to see what changes.

  2. Notes:

    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. (This is a big problem.)

    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   Textbook slides

We'll continue with the textbook powerpoint slides.

  1. 2_2, Programming with WebGL Part 1: Background.
  2. 2_3, Programming with WebGL Part 1: Background
  3. 2_4, Programming with WebGL Part 2: Complete Programs
  4. 2_5, Programming with WebGL Part 2: Complete Programs
  5. 3_1, Programming with WebGL Part 3: Shaders