CG Homework 3, due Thu 2016-09-22 9am

  1. (10 pts) Part of changing from one coordinate system to another is scaling and making things fit. E.g., suppose that you had a square with lower left corner (llc) (0,0) and upper right corner (urc) (1,1). You want to scale and center it to just fit into a rectangle with llc (0,0) and urc (2,3). The square stays a square but is probably larger or smaller. Then, these equations would do it:

    x' = 2x
    y' = 2y + 1/2

    This question is to figure out how to make a rectangle from (0,0) to (2,3) fit into a square that is from (0,0) to (10,10).

  2. (10 pts) Consider a pinhole camera as discussed in slide 12 of ppt presentation 1_5. Let d=2. To where does the point (1,3,-2) project? Use the equation on that slide. x/z/d should be parenthesized as x/(z/d).

  3. (5) If your image has only 64 different colors across the whole image, how many bits per pixel do you need for the color buffer?

  4. (25) Extend your program from last week that displays the Starship Enterprise as follows:

    1. Add 3 sliders that will rotate it around the X-axis, Y-axis, and Z-axis respectively.
    2. Do the rotations the simplest (and least efficient) way. I.e., in your javascript program, have render rotate the matrix and resend it to the GPU.

(Total: 50 points.)

CG Homework 2, due Wed 2016-09-14

Rules

  1. You may work in teams of 2. Each team should submit their solution under only 1 student's name, but mention both people at the top of the submission. The other student's submission should just name the lead student. (This makes it easier for us to track things and to avoid grading it twice.)

  2. Hand in your solution on RPILMS. As for formats, we'll take (at least) a scanned image of a neatly handwritten page, raw text, PDF, and MS Word.

  3. For the programming question, pick whichever you prefer to get us the code:

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

      It might be easier to move the utility .js files into the same directory as your code (and adjust the include lines).

    2. Put the code on a web server such as RCS.

Questions

  1. (5 pts) Which RPI grad was the technical person in the founding group of NVidia?

  2. (5 pts) What hardware component had to get much cheaper in order to make frame buffers possible?

  3. (5 pts) The progress of computer graphics has always been enabled by new hardware. One newish toy is Google Cardboard. Pretend that I've never heard of it, and write 100 words or so summarizing it and giving specific details.

  4. (20) Modify last week's program to display the spaceship NCC1701.

    1. The data is in the file ncc1701b.data . Each line gives the vertices of one triangle as follows:

      x1 y1 z1 x2 y2 z2 x3 y3 z3

    2. Insert the data into your javascript file and try displaying it.

    3. If this is too much data, then reduce the number of triangles until something displays. Report what went wrong, and how many triangles could be displayed.

    4. You might have to scale the data to fit. I'll let you figure out the easiest way to do that. The problem is that last week's square had coordinates in the range from -1 to 1, while the NCC1701 does not.

    5. Attach a PDF of any files you modified and a screendump. If the file has a multi-thousand line array, it's ok to delete the middle.

  5. (5) In real life, light bounces from object to object, on its way from the light source to the viewer. However, the OpenGL pipeline processes objects independently, and does not allow that (except the an object can hide another object). Why?

  6. (10) According to the tristimulus model, our eyes have three types of color receptors (cones). However several species and some rare human females have four types of cones. They are called tetrachromats.

    1. Name some such animals.
    2. For humans, why is it (probably; opinions differ) only females?

(Total: 50 points.)

CG Lecture 4, Wed 2016-09-07

  1. Accessing RCS files from non-RPI computer

    1. FileZilla for Windows
    2. http://dotcio.rpi.edu/services/file-services/mapping-network-drive-using-secureftp
    3. http://dotcio.rpi.edu/services/accounts-identity/rcs-accounts/connecting-your-rcs-home-directory
    4. http://dotcio.rpi.edu/services/file-services/mapping-network-drive-rcs-using-openafs-client
  2. Common square.html problem:

    The location mentioned in src="../Common/webgl-utils.js" etc is wrong.

  3. Know-it-all points: Already two students have earned points for finding nontrivial errors.

  4. Homework 2 is online; due next Wed.

  5. Serpinski gasket programs showing more complicated WebGL.

  6. Extra material on colors

    1. Tetrachromacy

      Some women have 2 slightly different types of green cones in their retina. They see 4 primary colors.

    2. Metamers

      Different colors (either emitted or reflected) with quite different spectral distributions can appear perceptually identical. With reflected surfaces, this depends on what light is illuminating them. Two surfaces might appear identical under noon sunlight but quite different under incandescent lighting.

    3. CIE chromaticity diagram

      This maps spectral colors into a human perceptual coordinate system. Use it to determine what one color a mixture of colors will appear to be. The curve of pure spectral colors was determined experimentally.

      1. More info: http://wikipedia.org/CIE_xyY .
      2. Purple is not a spectral color.
    4. Color video standards: NTSC, SECAM, etc

    5. My enrichment note on NTSC And Other TV Formats. NTSC, the American analog TV standard, is now getting obsolete. However it was a beautiful example of engineering design. First B&W TV was invented. Then color was added in a way that was upward compatible, downward compatible, and used no more bandwidth.

    6. Failed ideas: mechanical color TV. http://en.wikipedia.org/wiki/Mechanical_television (enrichment).

    7. Additive vs subtractive colors.

      1. http://www.physicsclassroom.com/Physics-Interactives/Light-and-Color/RGB-Color-Addition/RGB-Color-Addition-Interactive
    8. Sensitivity curves of the 3 types of cones vs wavelength.

      1. http://i.stack.imgur.com/5snTb.png
    9. Material reflectivity vs wavelength.

    10. Incoming light intensity vs wavelength.

    11. Retina is a neural net - Mach band effect. When one cone is brightly lit, it inhibits its neighbors from firing so easily. This acts like a high frequency filter, to emphasize small details in the scene. Note: the details of how this works are uncertain.

CG TA office hours

Shama Kollya's office hours are in the ECSE Flip Flop lounge in JEC 6037.

  1. Tuesdays and Fridays at 9am.
  2. She will try to stay as long as there are students asking questions, but will leave at 9:15 if no one has arrived.
  3. Exception: no office hour on 9/9.

She also answers email sent to kollysATrpiDOTedu .

CG HW1 addendum

Here is a more detailed description of the homework 1 square question. This assumes that your are using RCS as the web server. (You are free to use another web server.)

  1. Assume that your RCSID is STUDENT. In the following, replace STUDENT with your RCSID.
  2. From an RPI windows machine, click the AFS RPI icon create a share with your RCS files.
  3. Go into public_html.
  4. Create a folder called homeworks.

#. Copy the folder https://www.ecse.rpi.edu/homepages/wrf/Teaching/graphics-f2016/SEVENTH_EDITION/CODE/Common/ into homeworks.

  1. Create a subfolder hw1 under homeworks.
  2. Copy files https://www.ecse.rpi.edu/homepages/wrf/Teaching/graphics-f2016/SEVENTH_EDITION/CODE/CLASS/square.html and https://www.ecse.rpi.edu/homepages/wrf/Teaching/graphics-f2016/SEVENTH_EDITION/CODE/CLASS/square.js into that folder.
  3. Change them to answer the homework.
  4. Look at your answer by browsing to https://www.rpi.edu/~STUDENT/homeworks/hw1/square.html

When you've solved that question:

  1. Put your answers to all the homework questions in some file, even on your own PC.

    Include listing for the files you changed for square.

    Mention the URL to access your modified square, e.g., https://www.rpi.edu/~STUDENT/homeworks/hw1/square.html

  2. Upload that file of answers to LMS.

Shama Kollya, kollysATrpiDOTedu, the TA, will be glad to help with any problems.

CG Lecture 3, Thurs 2016-09-01

  1. Today will end at 5 because the President is holding a reception.

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

  3. Here is My local cache of Angel's web site . It may be faster to access.

    (Several times, I've been glad to have a local cache of some web site, because the web site later vanished.)

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

CG Homework 1, due Wed 2016-09-07

Homework 1, due Wed Sep 7, 2016

Hand in your solution on RPILMS. You may work in teams of 2. Each team should submit their solution under only 1 student's name, but mention both people at the top of the submission. The other student's submission should just name the lead student. (This makes it easier for us to track things and to avoid grading it twice.) As for formats, we'll take (at least) a scanned image of a neatly handwritten page, raw text, PDF, and MS Word.

  1. (4 pts) One graphics pioneer was Ivan Sutherland. Name an influential tool that he created and an influential algorithm that he helped create.

  2. (4) Consider these 3-D vectors: A=(0,4,2), B=(1,2,3), C=(8,7,9). Compute:

    1. A.(BxC)
    2. (AxB).C
  3. (4) (This is another a test of your linear algebra knowledge. Feel free to refer to books to find the correct formulae.)

    Suppose that we have a plane in 3-D thru the points A(3,2,0), B(2,2,0), and C(0,1,1).

    1. What is its equation, in the form ax+by+cz+d=0 ?
    2. Consider the line L thru the points O(0,0,0) and P(1,1,1). Where does this line intersect the plane?
  4. (4) Modify the program in http://www.cs.unm.edu/~angel/WebGL/7E/CLASS/square.html , which calls several other files, to display shapes that are the first initials of the last names of the team members.

    I'll give more details about how to do this in class on Wed Aug 31.

  5. (2) Do exercise 1.1 from the textbook, page 37.

  6. (2) Do exercise 1.8 from the textbook, page 38.

(Total: 20 points.)

CG Important Dates

Some important dates
When What
Aug 29 first class
Aug 31 lecture in lab time
Sep 5 no class
Sep 7 homework 1 due
Oct 5 lab run by TA
Oct 6 no class
Oct 10 no class
Oct 11 Monday class: review for midterm exam
Oct 13 midterm exam
Oct 17 term project title - team - 100 word summary
Oct 21 drop deadline
Oct 31 brief progress report.
Oct 31 no class
Nov 2 lab run by TA
Nov 3 no class
Nov 7-8 Dreamworks visits RPI
Nov 11 Pass N/C deadline
Nov 14 brief progress report.
Nov 23-25 no classes
Dec 5 7 8 term project videos shown to class.
Dec 8 last class
Dec 9 term project due
Dec 14-16 19-20 final exams

CG Lecture 1, Mon 2016-08-29

  1. Discuss Syllabus.
  2. Intro to OpenGL.
    1. It's a platform-neutral competitor to DirectX. See http://en.wikipedia.org/wiki/Comparison_of_OpenGL_and_Direct3D .
    2. The competition improves both.
    3. The designers made a decision to do ''only rendering'', no input, audio, or windowing.
    4. The OpenGL standards committee gradually adds and subtracts features.
    5. The goal is to exploit the latest GPUs while keeping the size manageable.
    6. This makes the ''hello world'' program much longer, but makes complicated graphics more efficient.
    7. OpenGL4 exploits latest GPU features. However many expensive business laptops, such as my Thinkpad x201 cannot run it.
    8. OpenGL4 being lower level opens a niche for a replacement easy-to-use graphics API. I recommend Qt.
    9. Tools like Blender are higher-level, very good for realistic scenes, but too fancy for simple graphics programming. I'll leave them to other classes.
    10. See http://en.wikipedia.org/wiki/Opengl .
    11. WebGL is an API for HTML5.
    12. This course uses JavaScript because web-based graphics is easier with it.
    13. Although JavaScript is less efficient than C++, the serious graphics computing is done on the graphics card.
    14. The OpenGL API for C++ is quite similar to JavaScript's. Instead of the JavaScript framework, you need a C++ toolkit to provide the the higher level functions that OpenGL chose not to provide. This includes creating windows. GLUT is one such toolkit. It is widely used but old. There are other newer ones.
  3. Why is this course different?
    1. Shader-based
    2. Most computer graphics use OpenGL but still use fixed-function pipeline, don't require shaders, do not make use of the full capabilities of the graphics processing unit (GPU)
    3. Web: With HTML5, WebGL runs in the latest browsers. Makes use of local hardware, No system dependencies.
  4. Some web resources
    1. http://www.cs.unm.edu/~angel/
    2. http://www.cs.unm.edu/~angel/WebGL/7E
    3. http://www.opengl.org
    4. http://get.webgl.org
    5. http://www.kronos.org/webgl
    6. http://www.chromeexperiments.com/webgl
    7. http://learningwebgl.com
  5. Long history of attempts at a good API described in text.
  6. OpenGL, 1992:
    1. platform-independent API that was
    2. Easy to use
    3. Close enough to the hardware to get excellent performance
    4. Focus on rendering
    5. Omitted windowing and input to avoid window system dependencies
  7. OpenGL evolution
    1. Originally controlled by an Architectural Review Board (ARB)
    2. Members included SGI, Microsoft, Nvidia, HP, 3DLabs, IBM,…….
    3. Now Kronos Group
    4. Was relatively stable (through version 2.5)
    5. Backward compatible
    6. Evolution reflected new hardware capabilities
    7. 3D texture mapping and texture objects
    8. Vertex and fragment programs
    9. Allows platform specific features through extensions
  8. Modern OpenGL
    1. Performance is achieved by using GPU rather than CPU
    2. Control GPU through programs called shaders
    3. Application’s job is to send data to GPU
    4. GPU does all rendering
  9. Immediate Mode Graphics
    1. Geometry specified by vertices
      1. Locations in space (2 or 3 dimensional)
      2. Points, lines, circles, polygons, curves, surfaces
    2. Immediate mode
      1. Each time a vertex is specified in application, its location is sent to the GPU
      2. Old style uses glVertex
      3. Creates bottleneck between CPU and GPU
      4. Removed from OpenGL 3.1 and OpenGL ES 2.0
  10. Retained Mode Graphics
    1. Put all vertex attribute data in array
    2. Send array to GPU to be rendered immediately
    3. Almost OK but problem is we would have to send array over each time we need another render of it
    4. Better to send array over and store on GPU for multiple renderings
  11. OpenGL 3.1
    1. Totally shader-based
      1. No default shaders
      2. Each application must provide both a vertex and a fragment shader
    2. No immediate mode
    3. Few state variables
    4. Most 2.5 functions deprecated
    5. Backward compatibility not required
      1. Exists a compatibility extension
  12. Other Versions
    1. OpenGL ES
      1. Embedded systems
      2. Version 1.0 simplified OpenGL 2.1
      3. Version 2.0 simplified OpenGL 3.1
      4. Shader based
    2. WebGL
      1. Javascript implementation of ES 2.0
      2. Supported on newer browsers
    3. OpenGL 4.1, 4.2, …..
      1. Add geometry, tessellation, compute shaders
  13. Source of much of this material: slides accompanying the text.
  14. Reading assignment: Angel, chapter 1.
  15. Homework 1 is online; due next Wed.
  16. This Wed Aug 31 will be a lecture and SW session, held in the usual lab room.