CG Syllabus

1   Course content

1.1   Catalog description

ECSE-4750 Computer Graphics

Introduction to Interactive Computer Graphics, with an emphasis on applications programming. Objects and viewers, and the synthetic camera model. Graphics architectures, the graphics pipeline, clipping, rasterization, and programmable shaders. Input and interaction. Geometric objects, homogeneous coordinates, and transformations. Viewing, hidden surface removal, frame and depth buffers, compositing, and anti-aliasing. Shading, light and materials, texture mapping, ray tracing, and radiosity. Intellectual property concerns. Extensive programming with the OpenGL API. Prerequisite: ECSE-2610 Computer Components & Operations, or CSCI-2500 Computer Organization, or equivalent. Fall term annually. 3 credit hours

CRN: 25164

1.2   Why take this course?

To understand and control the universe.

The massive data sets being produced by cheap sensors are useless unless they can be understood by people. Complicated machines are useless unless they can be easily controlled. This course will help you do both. The key is graphics and visualization. We don't just teach useful platform-independent tools. We also teach the underlying math and algorithms used by all tools so that you can design better tools.

1.3   How this course relates to other graphics courses at RPI

  1. My course gives you the math and programming skills to create the next generation replacements for the higher level tools that other courses use.
  2. OpenGL is the low-level assembly language of computer graphics. It gives you a more direct control of the HW. Higher level tools, like Blender, build on top of OpenGL. Higher level concepts, like ray tracing, are implemented in OpenGL.
  3. OpenGl is preferable to DirectX because OpenGl is open, vendor-neutral, and OS-neutral.
  4. The problem with very high level tools, like Blender, is that they restrict what you can do if what you want is outside the Blender model. You would use OpenGL to create Blender's replacement.
  5. Only OpenGl small enough to make available on smartphones.

1.4   Overall Educational Objective

To provide students with a foundation in graphics applications programming.

1.5   Learning Outcomes

  1. to develop a facility with the relevant mathematics of computer graphics, e.g.,
    1. 3D rotations using both vector algebra and quaternions, and
    2. transformations and projections using homogeneous coordinations.
  2. to learn the principles and commonly used paradigms and techniques of computer graphics, such as
    1. the graphics pipeline,
    2. Splines and NURBS,
    3. ray tracing,
    4. visibility algorithms.
  3. to gain a proficiency with OpenGL, "a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics." - Wikipedia OpenGL is the most widely used platform-independent API, used on applications from games to virtual reality, implemented on platforms from mobile phones to supercomputers.

1.6   Why (Not) To Take This Course

Other courses might be a better fit if:

  1. You don't like programming.
  2. You don't like documenting your programs.
  3. You don't like math.
  4. You don't like reading.
  5. You don't like writing exams at the official scheduled times. The final exam may be as late as Dec 20.

OTOH, here are some reasons that you might prefer to take a course from me.

  1. I teach stuff that's fun and useful.
  2. I acknowledge that you are simultaneously taking several courses, and so try to make the workload fair. E.g., if you're taking 6 3-credit courses, then you should not be required to spend more than \(\frac{168}{6}\) hours per week per course :-).
  3. I try to base exam questions more on important topics that occupied a lot of class time, and which are described in writing, often on this wiki.
  4. I keep the course up-to-date and relevant.

1.7   Prerequisites

  1. This is a senior CSYS course, and assumes a moderate computer maturity, represented in the catalog by either listed prereq. If you don't have either specific course, talk to me.
  2. You also must know some high level language, such as C++, sufficient to learn Javascript. One of many good online tutorials is W3Schools JavaScript Tutorial.
  3. Computer Graphics also assumes that you know, or be able to learn, some basic linear algebra, up to the level of what an eigenvalue is.
  4. If you're uncertain about taking this course, then, by all means, talk to me, or to previous people in it. If there is one specific fact that is unfamiliar, such as eigenvalue, then there's no problem at all.

2   Instructors

2.1   Professor

h W. Randolph Franklin. BSc (Toronto), AM, PhD (Harvard)

Office:

Jonsson Engineering Center (JEC) 6026

Phone:

+1 (518) 276-6077 (forwards)

Email:

mail@wrfranklin.org or frankwr@rpi.edu

Email is my preferred communication medium.

Sending from a non-RPI account is fine (and is what I often do). However, please use an account that shows your name, at least in the comment field. A subject prefix of #CG is helpful. GPG encryption is welcomed.

Web:

http://wrfranklin.org/

Office hours:

After each lecture, usually as long as anyone wants to talk. Also by appointment.

Informal meetings:
 

If you would like to lunch with me, either individually or in a group, just mention it. We can then talk about most anything legal and ethical.

Background:

I've been doing graphics related programming since the 1960s, and have been teaching versions of this course since 1982. I've been at RPI since 1978, apart from several absences, including a year at Berkeley, 3 months at Genoa (Italy), and shorter times at Laval University in Quebec City (Canada), the Commonwealth Scientific and Industrial Research Organization in Canberra (Australia), and the National University of Singapore. I also spent 2 years 7 months as Director of the Numeric, Symbolic, and Geometric Computation Program at the National Science Foundation, recommending how to spend about $30M of your tax dollars (thanks!).

A recent funded research project was (together with Cutler and Zimmie) modeling how levees fail when overtopped during a flood. Google Scholar thinks that I've co-authored 47 papers that each have been cited at least 10 times.

Another recent completed research project was on representing terrain elevation, and compressing it, and siting observers and planning paths on it, was largely supported by the Defense Advanced Research Projects Agency. DARPA people are crazy. My main worry was that I wasn't crazy enough for them.

In the summer of 2013, I was sponsored by FAPEMIG, the science funding agency of the state of Minas Gerais in Brazil to spend a month in Brazil working with researchers at various universities.

I also like to examine terrain on foot; in summer 2008 I walked 164km, including 11km up, from Chamonix to Zermatt, in 12 days (the Haute Route). In March 2009, I hiked the Grand Canyon from south rim to Colorado River and back in one day. I spent July 2009 visiting universities in Brazil, with a few days kayaking down the Urubu R, a tributary of the Amazon, sleeping in a hammock tied to trees, and hiking for hours through the jungle. In July 2014 I hiked the Zion Virgin River Narrows slot canyon top-down. In 2015, I finished hiking all of the 115 4000' peaks in the northeast (the NE111).

2.2   Teaching assistant

  1. Shama Kollya, kollysATrpiDOTedu (15 hours/week)
  2. Office hours:
    1. ECSE Flip Flop lounge in JEC 6037.
    2. Tuesdays and Fridays at 9am.
  3. She will try to stay as long as there are students asking questions, but will leave at 9:15 if no one has arrived.
  4. Come near the start of the time; if there is no one there she may leave.
  5. If you need more time, or a different time, then write, and she will try to accommodate you.
  6. She also attends most lectures.

3   Course websites

3.1   Homepage

This current page http://www.ecse.rpi.edu/Homepages/wrf/Teaching/graphics-f2016 has lecture summaries, syllabus, homeworks, etc.

3.2   Google calendar

This Google calendar lists classes, assignments, due dates, TA office hours, etc. You may display it together with other Google calendars or import into into various other calendar programs, like Thunderbird.

  1. I will update the calendar as the semester progresses.

  2. The titles of all events on this calendar will start with CG. This will be useful if you are displaying several calendars together.

    There is a separate page for important dates.

4   Reading material

4.1   Textbook

  1. Interactive Computer Graphics: A Top-Down Approach with WebGL, Seventh Edition, Edward Angel; Dave Shreiner.

    I picked this book because it covers WebGL, which is more portable, and because it has better supplementary material. Also, this book is widely used by other colleges.

  2. RPI bookstore site, containing prices for many purchase or rental options.

  3. Textbook author's site, containing assorted stuff, like slides and code.

4.2   My notes on various graphics topics

These will supplement the text. I'll link them in to the lecture notes at the appropriate times.

4.3   Assorted online material

There is a lot of good, free, online material about OpenGL and graphics in general. I'll mention some of it; Google can find more.

5   Computer systems used

You will need the following computer systems; they could all be on one computer.

Public web server:
 

This course will use platform-independent OpenGL computer graphics written in Javascript and displayed with any major browser, including smart phones.

You will need to be able to create web pages with extensions .js and .html (or .htm) on some web server. RCS will do. The URL to display the pages will be something like http://www.rpi.edu/~frankwr/ .

How you upload the files to RCS depends on where you're coming from.

  1. From my linux box, the location is /afs/rpi.edu/home/56/frankwr/public_html/ .
  2. From an RPI windows machine, you connect a network share. There's an icon labeled something like RPI-AFS.
  3. Filezilla and sftp are also said to work.
  4. If you're off campus, you need to start the VPN first.

You are free to use any other server that the TA and I can access.

Web client:

You will need a web browser that can render and interact with WebGL pages. Most modern browsers, including smart phones, work.

You do not need a discrete graphics card.

To see if your computer is adequate, try this WebGL1 test or Angel's examples.

Misc other computing:
 

For some homeworks, you might need to run other computer programs. Generally I'll let you choose how to solve a given problem, i.e., what SW and OS to use.

6   LMS

RPI LMS will be used only for you to submit homeworks and for us to distribute grades.

Announcements and the homeworks themselves will be available on this website.

7   Class times & places

  1. Mon & Thurs, 4-5:20pm, in Darrin 324 (lectures).
  2. Wed 6-7:30, in Sage 5101 (lab/recitation/lecture).

Wed will not always be used. Typical uses:

  1. To make up a missed class.
  2. For student presentations at the end.
  3. To review before a test.
  4. For TA meetings.

I intend no class activities outside the scheduled times, except for a final exam review, a day or two before the exam.

7.1   Lectures

You may miss classes. However

  1. You will miss iclicker points. However all the iclickers together are only 5%.
  2. You are also still responsible for knowing what happened.
  3. However, important announcements will be posted on the web.
  4. Except when some equipment fails, I post an copy of everything that I write in class.
  5. I may base exam questions on student questions in class.
  6. If you're scheduled to present something, say a term project summary, then you can't miss that.

You may use computers etc in class if you don't disturb others.

I welcome short questions, if the answers are also short.

8   Assessment measures, i.e., grades

You are welcome to put copies of exams and homeworks in test banks, etc, if they are free to access. However since I put everything online, it's redundant.

8.1   Midterm exam

  1. There will be a midterm exam in class on Thurs Oct 13, except for force majeure. (That means an unexpected big event, such as RPI being closed that day.)
  2. If you have special needs, give me the memo by the week before, so that I can schedule someone to proctor you.
  3. The Tues Oct 11 lecture will be a review.
  4. The exam may contain some recycled homework questions.
  5. Here are several old exams, with some solutions. This year's topics will be slightly different, but will be largely the same. OTOH, since there are a finite number of electrons in the universe and they say that recycling is good, I'll recycle many of these questions.
    1. Midterm F2014, Midterm F2014 Solution
    2. Midterm F2013, Midterm F2013 Solution
    3. Midterm F2012, Midterm F2012 Solution

If you prepared answers to all the questions on all the old tests, then you'd do well this semester, except for the new stuff. However, you would also deserve to do well since you'd know the material.

  1. I'll discuss other answers in the review, or you may figure out answers on your own.

  2. You may bring in one 2-sided 8.5"x11" paper with notes. You may not share the material with each other during the exam. No collaboration or communication (except with the staff) is allowed.

  3. As this chart shows, there is no correlation between the time taken to write the exam and the resulting grade.

    ../../images/ComputerGraphicsFall2007-midterm-grade-order.png

8.2   Homeworks

There will be a homework approximately every week. You are encouraged to do the homework in teams of 2, and submit one solution per team, on LMS, in any reasonable format. The other term member should submit only a note listing the team and saying who submitted the solution.

"Reasonable" means a format that the TAs and I can read. A scan of neat handwriting is acceptable. I might type material with a wiki like pmwiki or blogging tool, sketch figures with xournal or draw them with inkscape, and do the math with mathjax. Your preferences are probably different.

8.3   Term project

  1. For the latter part of the course, most of your homework time will be spent on a term project.
  2. The project must be written in WebGL.
  3. You will implement, demonstrate, and document something at least vaguely related to Computer Graphics. Here are some ideas:
    1. A tutorial program to demo some idea in this course, such as quaternions, which I might use in future years.
    2. A 3D game.
    3. A psychophysics experiment to test how well users can match colors.
    4. A physical simulation of 3 body orbits.
    5. A 3D fractal or julia set generator.
    6. An L-systems generator for random plants (as in botany).
    7. Something in stereo using Google Cardboard.
  4. You are encouraged do it in teams of up to 3 people. A team of 3 people would be expected to do twice as much work as 1 person.
  5. You may combine this with work for another course, provided that both courses know about this and agree. I always agree.
  6. You may build on existing work, either your own or others'. You have to say what's new, and have the right to use the other work. E.g., using any GPLed code or any code on my website is automatically allowable (because of my Creative Commons licence).
  7. You will show a 3 minute video of your project in class, and then answer questions for one minute.
  8. You may demo it to the TA in one of the last few labs. A good demo will help; a bad demo hurt.
  9. Submit stuff on RPILMS as a tarball or zipfile containing any reasonable format of files or links to files. Each team should make only one substantive submission. The other term members should submit only a note listing the team and saying who made the real submission.
  10. For the video showing in class, there will be a signup sheet; sign up early to get your first choice.
Some important dates
When What
Oct 20 9am term project title - team - 100 word summary
Nov 3 brief progress report.
Nov 17 brief progress report.
Dec 5 7 8 term project videos shown to class.
Dec 9 term project due

8.3.1   Size of term project

It's impossible to specify how many lines of code makes a good term project. E.g., I take pride in writing code that is can be simultaneously shorter, more robust, and faster than some others. See my 8-line program for testing whether a point is in a polygon: Pnpoly.

According to Big Blues, when Bill Gates was collaborating with around 1980, he once rewrote a code fragment to be shorter. However, according to the IBM metric, number of lines of code produced, he had just caused that unit to officially do negative work.

  1. Some winners of The International Obfuscated C Code Contest (IOCCC) implement graphics projects in amazingly short programs. Note the beautiful formatting of many programs.
    1. 28 line ray-tracing program.
    2. 63 line interactive color auto racing program.
    3. 60 line interactive flight simulator.
    4. 8 line flying spheres program. However its graphics is pretty primitive.
    5. 73 line missile command game.
    6. 72 line Othello game, which beats me.
    7. 31 line 1st person maze walker, with perspective display.
    8. 115 line interactive fractal program, that puts up 2 X windows.

8.3.2   Deliverables

  1. An implementation showing
    1. interaction and
    2. 3D graphics.
  2. A video showing it running.
  3. A user guide showing how to use it.
  4. An implementation manual showing major design decisions.
  5. A class presentation of the video followed by 1 minute of questions.
Grading
Video  
project clearly described 10
good use of video or graphics 10
neat and professional 10
Project itself  
Graphics programming with good coding style 10
Use of interactivity or 3D 10
A nontrivial amount of it works (and that is shown) 10
Unusually creative 10
Writeup  
describes key design decisions 10
good examples 10
neat and professional 10
Total 100

A 10-minute demonstration to the TA is optional. If you do, she will give me a modifier of up to 10 points either way. I.e., a good demo will help, a bad one hurt.

8.4   Final exam

There will be a final exam on a date set by the Registrar. You may bring in two 2-sided 8.5"x11" sheets of paper with notes. You may not share bthe material with each other during the exam. No collaboration or communication (except with the staff) is allowed. The final exam will contain material from the whole course, but more from the last half. (new)

  1. Final exam F2014, Final exam F2014 solution,
  2. Final exam F2013, Final exam F2013 solution,
  3. Final exam F2012, Final exam F2012 solution,

The required final exam might be as late as Dec 20. Do not make travel plans that conflict with the exam.

Do not buy airplane tickets and then wait until the last minute to say that you can't write an exam. If your parents still plan your life w/o telling you, then tell them. If you wish, I can tell them.

8.5   Iclickers

Iclicker questions will be posed in most classes. The questions are intended to be easy. Please bring your iclickers.

8.6   Correcting the Prof's errors

Occasionally I make mistakes, either in class or on the web site. The first person to correct each nontrival error will receive an extra point on his/her grade. One person may accumulate several such bonus points.

8.7   Extra bonuses

Constructive participation in class, and taking advantage of office hours may make a difference in marginal cases.

8.8   Weights and cutoffs

Relative weights of the different grade components
Component Weight
iClicker questions 5%
All the homeworks together 23%
Midterm exam 24%
Term project 24%
Final exam 24%

Even if the homeworks be out of different numbers of points, they will be normalized so that each homework has the same weight, except that the lowest homework will be dropped, as described below.

Grade cutoffs:
Percentage grade Letter grade
>=95.0% A
>=90.0% A-
>=85.0% B+
>=80.0% B
>=75.0% B-
>=70.0% C+
>=65.0% C
>=60.0% C-
>=55.0% D+
>=50.0% D
>=0% F

However, if that causes the class average to be lower than the prof and TA feel that the class deserves, based on how hard students appeared to work, then the criteria will be eased.

8.9   Missing or late work

  1. We will drop the lowest homework grade. That will handle excused absences, unexcused absences, dying relatives, illnesses, team trips, and other problems.
  2. Late homeworks will not be accepted.
  3. If you miss the midterm because of an excused absence, we will use your final exam grade also as your midterm grade.
  4. If you miss the final exam because of an excused absence, you may demonstrate your knowledge of the 2nd half of the course at an individual oral makeup exam.
  5. If your term project is late, you will be offered an incomplete and the project will be graded in Jan 2017.

8.10   Grade distribution & verification

  1. We'll post homework grading comments on LMS. We'll return graded midterm exams in class.
  2. If you disagree with a grade, then please
    1. report it within one week,
    2. in writing,
    3. emailed to the TA, with a copy to the prof.
  3. From time to time, we'll post your grades to LMS. Please report any missing grades within one week to the TA, with a copy to the prof.
  4. It is not allowed to wait until the end of the semester, and then go back 4 months to try to find extra points. It is especially not allowed to wait until the end of the following semester, and then to ask what you may do to raise your grade.
  5. We maintain standards (and the value of your diploma) by giving the grades that are earned, not the grades that are desired. Nevertheless, this course's average grade is competitive with other courses.
  6. Appeal first to the TA, then to the prof, then to any other prof in ECSE acting as a mediator (such as Prof Wozny, the curriculum chair), and then to the ECSE Head. It is preferable to state your objection in writing.

8.11   Mid-semester assessment

After the midterm, and before the drop date (Oct 21, 2016), we will compute an estimate of your performance to date.

8.12   Early warning system (EWS)

As required by the Provost, we may post notes about you to EWS, for example, if you're having trouble doing homeworks on time, or miss an exam. E.g., if you tell me that you had to miss a class because of family problems, then I may forward that information to the Dean of Students office.

9   Academic integrity

  1. See the Student Handbook for the general policy. The summary is that students and faculty have to trust each other. After you graduate, your most important possession will be your reputation.

Specifics for this course are as follows.

  1. You may collaborate on homeworks, but each team of 1 or 2 people must write up the solution separately (one writeup per team) using their own words. We willingly give hints to anyone who asks.
  2. The penalty for two teams handing in identical work is a zero for both.
  3. You may collaborate in teams of up to 3 people for the term project.
  4. You may get help from anyone for the term project. You may build on a previous project, either your own or someone else's. However you must describe and acknowledge any other work you use, and have the other person's permission, which may be implicit. E.g., my web site gives a blanket permission to use it for nonprofit research or teaching. You must add something creative to the previous work. You must write up the project on your own.
  5. However, writing assistance from the Writing Center and similar sources in allowed, if you acknowledge it.
  6. The penalty for plagiarism is a zero grade.
  7. You must not communicate with other people or machines, exchange notes, or use electronic aids like computers and PDAs during exams.
  8. The penalty is a zero grade on the exam.
  9. Cheating will be reported to the Dean of Students Office.

11   Student feedback

Since it's my desire to give you the best possible course in a topic I enjoy teaching, I welcome feedback during (and after) the semester. You may tell me or write me or Shama Kollya, or contact a third party, such as Prof Gary Saulnier, the ECSE undergrad head, or Prof Mike Wozny, the ECSE Dept head.

CG Lecture 19, Wed 2016-10-19

  1. Handwritten notes from Monday.

  2. I updated the syllabus to reflect the delayed due dates for the term project proposal and status reports. Now, they're all on Thurs 9am, the same as the homeworks. However the final presentations and due dates are the same. RPI prohibits classwork from being due after the end of classes.

  3. Help Wanted: Students needed to help create VR App

    "My name is Loren Bass and I am the new Assistant Director of Graduate Admissions. I would love to see if you know any students who would be interested in helping our team create a VR app for our Fall 2017 recruitment efforts. The idea came as I noticed an article about Georgia Tech’s MBA recruitment team (https://www.scheller.gatech.edu/news-events/latest-news/2016/articles/scheller-college-uses-virtual-reality-to-reach-mba-prospects-across-the-us%20.html) and would love to make sure RPI stays competitive in recruiting the top future leaders for our programs. If you know any students who would be interested in helping build this experience during the spring and summer semesters I would sincerely appreciate the help.

    Many thanks,

    Loren Bass"

    (This could be a term project - WRF).

  4. Iclicker questions.

  5. Summary of recent powerpoint slides.

    1. I didn't show WebGL Transformations Angel_UNM_14_5_4.ppt since it is mostly obsolete.

      1. The old OpenGL modelview and projection matrix idea is now deprecated, but is interesting for its subdivision of transformations into two functions.
      2. The modelview matrix moves the world so that the camera is where you want it, relative to the objects. Unless you did a scale, the transformation is rigid - it preserves distances (and therefore also angles).
      3. The projection matrix view-normalizes the world to effect your desired projection and clipping. For a perspective projection, it does not preserve distances or angles, but does preserve straight lines.
    2. 6_1 Applying Transformations.

    3. 6_2 Building Models.

      Big idea: separate the geometry from the topology.

    4. The Rotating Square.

      Big idea: render by elements.

    5. 6_3 Classical Viewing.

      Big ideas: parallel (orthographic) and perspective projections. The fine distinctions between subclasses of projections are IMO obsolete.

    6. 6_4 Computer Viewing: Positioning the Camera.

    7. 6_5 Computer Viewing: Projection.

      Big idea: view normalization. We'll see this more in chapter 7.

  6. Notes about the computer programs:

    1. The point is not to teach javascript; it's just the vehicle. Before javascript, I taught C++. Javascript is easier.
    2. One point is to teach a widely used API, i.e., WebGL.
    3. Another point is to teach graphics concepts like projection and viewing, and their APIs, like lookAt.
    4. These concepts will exist in any graphics API.
  7. Programs from chapter 5.

    1. hata shows:
      1. Using a modelview matrix set by lookat and a projection matrix set by ortho
      2. Drawing a mesh with line strips.
    2. hat shows:
      1. Drawing the same points both as a triangle fan and as a line loop.
      2. Setting options to make the lines slightly in front of the triangles.
      3. Doc for depthfunc.
      4. Doc for polygonoffset.
    3. ortho1 and ortho2 show clipping with an interactive orthographic (parallel) projection.
    4. perspective1 and 2 show an interactive perspective projection.
    5. shadow shows a shadow.
  8. New slides:

    1. 7_1 Orthogonal projection matrices.

      Big idea: Given any orthogonal projection and clip volume, we transform the object so that we can view the new object with projection (x,y,z) -> (x,y,0) and clip volume (-1,-1,-1) to (1,1,1) and get the same image. That's a normalization transformation'. See slide 14.

    2. 7_2 Perspective projection matrices and the normalization transformation.

      Big idea: We can do the same with perspective projections. The objects are distorted like in a fun house. See slide 8.

  1. 7_3 Meshes.

    Big ideas:

    1. Meshes are common for representing complicated shapes.
    2. We can plot a 2 1/2 D mesh back to front w/o needing a depth buffer.
    3. Unstructured point clouds with millions of points from laser scanners are common. We can turn them into a mesh by using various heuristics about the expected object.
    4. Drawing the mesh edges a little closer than the faces is a hack that probably works most of the time if the scene isn't too complex. I.e., go ahead and use it, but don't be surprised.

CG Lecture 18, Mon 2016-10-17

  1. The final exam is Wednesday, 12/14, 11:30-2:30.

  2. Last Thursday's midterm exam is online.

  3. The following iclickers are being used in class, but have not been registered:

    #38AB7FEC #39C8E415 #3B96FF52 #3BAA0594 #3BC29861 #3BE21EC7 #42221F7F #429E3BE7

    Please register them to get credit.

    I emailed all students who are on the classlist but have no iclicker registered for their name. That is a longer list, which suggests that some students on the classlist have not registered and also are not iclicking.

  4. This Wed: lecture.

  5. Today: review homogeneous coords, projections.

  6. Slide set 3 and on from chap 6

CG ECSE-4750 Computer Graphics Midterm, RPI, Thurs 2016-10-13

Name, RCSID:

.




.

Rules:

  1. You have 60 minutes.
  2. You may bring in one 2-sided 8.5"x11" paper with notes.
  3. You may not share material with each other during the exam.
  4. No collaboration or communication (except with the staff) is allowed.
  5. There are 20 questions. Check that your copy of this test has all the pages.
  1. (2 pts) If you wanted to change all the vertex positions by multiplying each x-coordinate by the same vertex's y-coordinate, the best place to do it is:

    1. with a javascript function
    2. in the vertex shader
    3. in the fragment shader
    4. in the html file
    5. it can't be done.
    .
    
    .
    
  2. (2 pts) Put these graphics pipeline components in the correct order:

    1. fragment-shader
    2. primitive-assembly
    3. rasterizer
    4. vertex-shader
    .
    
    
    
    .
    
  3. (2 pts) Name an advantage and a disadvantage of standards.

    .
    
    
    
    
    
    
    
    
    
    .
    
  4. (2 pts) If you do not tell OpenGL to do hidden surface removal, and two objects overlap the same pixel, then what color is that pixel?

    1. OpenGL throws an error.
    2. the closer object
    3. the farther object
    4. the first object to be drawn there
    5. the last object to be drawn there
    .
    
    .
    
  5. (2 pts) If i and j are quaternions, what is (i+j)(1+j)?

    .
    
    
    
    
    
    .
    
  6. (2 pts) Adding (1+2i) to the complex representation of the point (x,y) is equivalent to doing what to it?

    .
    
    
    
    
    .
    
  7. (2 pts) What is the quaternion for the rotation around the axis \(\left(\frac{3}{13}, \frac{4}{13}, \frac{12}{13}\right)\) by 180 degrees?

    .
    
    
    
    
    
    
    .
    
  8. (2 pts) How would you best send the location of a global light source to the vertex shader?

    1. as a varying variable.
    2. as a uniform variable.
    3. in another array similar to the vertex array.
    4. with a bindBuffer call.
    5. as an attribute.
    .
    
    
    
    .
    
  9. (2 pts) Why can the following not possibly be a 3D Cartesian rotation matrix?

    \(\begin{pmatrix} 1& 0 &1\\1 & 0 &0\\0& 0 &1\end{pmatrix}\)

    .
    
    
    
    
    
    .
    
  10. (2 pts) Name the 2 types of shaders that every WebGL program must have.

    .
    
    
    
    
    
    .
    
  11. (2 pts) What is the CIE chromaticity diagram good for?

    .
    
    
    
    
    
    
    .
    
  12. (2 pts) What hardware advance made raster graphics possible?

    .
    
    
    
    
    .
    
  13. (2 pts) What method of doing rotation suffers from gimbal lock?

    .
    
    
    
    
    .
    
  14. (2 pts) Describe how to implement picking.

    .
    
    
    
    
    
    
    
    
    .
    
  15. (2 pts) What is the purpose of gl-canvas in this line of code:

    canvas = document.getElementById( "gl-canvas" );

    .
    
    
    
    
    
    
    
    
    .
    
  16. (2 pts) What does this line of code do:

    gl.viewport( 0, 0, canvas.width, canvas.height );

    .
    
    
    
    
    
    
    
    
    .
    
  17. (2 pts) What does this line of code do:

    window.requestAnimFrame(render);

    .
    
    
    
    
    
    
    
    
    .
    
  18. (2 pts) Name 2 things that this does:

    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iBuffer);

    .
    
    
    
    
    
    
    
    
    .
    
  19. (2 pts) What is the purpose of vPosition in this line of code?

    var vPosition = gl.getAttribLocation( program, "vPosition" );

    .
    
    
    
    
    
    
    
    
    .
    
  20. (2 pts) Suppose that your vertex shader computed some property of each vertex and wanted the rasterizer to compute a weighted value of that property for each fragment. What type of variable would your vertex shader store that property in?

    .
    
    
    
    
    
    
    
    
    .
    

End of midterm

CG Lecture 17, Wed 2016-10-12

  1. Handwritten notes from Tues.
  2. Handwritten notes from today.
  3. Midterm exam is this Thurs in this room, 4-5pm (60 minutes).
    1. You may bring in one 2-sided 8.5"x11" paper with notes.
    2. You may not share material with each other during the exam.
    3. No collaboration or communication (except with the staff) is allowed.
    4. My intent is that the exam be short enough that everyone finish early. (Grammar experts may note that I used the subjunctive mood in the last sentence.)
    5. Today I'll take questions and review the course so far.
  4. Here are the iclicker questions so far. You can ask for the answers again today.
  5. On Monday, project proposals were going to be due, but I'll postpone that to Thurs. That will replace the next homework. Details about the project are in the syllabus.
  6. Today:
    1. I'll answer any final exam questions.
    2. Continue my take on homogeneous coordinates.

CG Lecture 16, Tues 2016-10-11

  1. Midterm exam is this Thurs in this room, 4-5pm (60 minutes).
    1. You may bring in one 2-sided 8.5"x11" paper with notes.
    2. You may not share material with each other during the exam.
    3. No collaboration or communication (except with the staff) is allowed.
    4. My intent is that the exam be short enough that everyone finish early. (Grammar experts may note that I used the subjunctive mood in the last sentence.)
    5. Today I'll take questions and review the course so far.
  2. Tonight I'll upload the iclicker questions so far. You can ask for the answers again on Wed.
  3. On Monday, project proposals were going to be due, but I'll postpone that to Thurs. That will replace the next homework. Details about the project are in the syllabus.
  4. If there's time, more about homogeneous coordinates.
  5. This Wed:
    1. I'll answer exam questions.
    2. More homogeneous coordinates.

CG Lecture 15, Mon 2016-10-3

  1. More programs in <http://www.ecse.rpi.edu/~wrf/Teaching/graphics-f2016b/SEVENTH_EDITION/CODE/Code%20new/03/>.

  2. More iclicker questions.

  3. Textbook slides from week 5.

    1. Chap 5
  4. I accidentally made Homework 5 too hard. Question 5, the Star Trek program, is postponed until next week.

  5. Nice WebGL site: http://webglfundamentals.org/webgl/lessons/

  6. The big topic for Chapter 5 is homogeneous coordinates. They allow all the common transformations - translation, rotation, scaling, projection - to be expressed as a multiplication by a 4x4 matrix.

    My take on homogeneous coordinates.

  7. Reminder that, per the syllabus, the midterm exam will be Thurs Oct 13, with a review on Tues Oct 11.

CG Homework 6, due Thu 2016-10-13 9am

  1. (20) Extend your program from last week that displays the Starship Enterprise as follows:
    1. For each triangle, compute its surface normal in the .js file.
    2. Use that normal to compute a color for the triangle. Make the red component proportional to the X component of the normal. Make .. green .. y, blue .. z.
    3. Attend each triangle's color to its 3 vertices and send that to the vertex shader.
    4. Color the triangles accordingly. In this simple exercise, each triangle's color will be flat.
    5. Now you should start to be able to see the 3D object.

(Total: 20 points.)

CG Lecture 14, Thurs 2016-09-29

  1. Shama's office hour tomorrow will end at 9:55 (however if you want to see her, go at 9). She will also be in class today after the lecture until 5:30.

  2. Handwritten notes on tablet from 09-28.

  3. More programs in <http://www.ecse.rpi.edu/~wrf/Teaching/graphics-f2016b/SEVENTH_EDITION/CODE/Code%20new/03/>.

  4. New stuff in those programs:

    1. Callbacks for mouse down, up, and motion.
    2. (Remember that an attribute variable is different for each vertex. I.e,., it's an attribute of the vertex. So far, the only attribute variable has been the vertex's position.)
    3. Now we'll see adding a second attribute variable - to represent each vertex's color.
    4. Another common possible attribute is a surface normal at each vertex.
    5. For each new attribute, define a new varying variable in the vertex shader.
    6. Give it some value probably computed from the attribute.
    7. The rasterizer will interpolate a value for each pixel from the values at the triangle's vertices.
    8. Define the same varying variable in the fragment shader to get that interpolated value.
    9. E.g., if the 3 vertices making a triangle have different colors, then the rasterizer will interpolate the color of each fragment, just as it interpolates each fragment's position.
  5. More iclicker questions.

  6. More textbook slides from chapter 4.

    1. Position Input
    2. Picking
    3. Geometry
  7. Picking

    The user selects an object on the display with the mouse. How can we tell which object was selected? This is a little tricky.

    E.g., It's not enough to know what line of code was executed to draw that pixel (and even determining that isn't trivial). That line may be in a loop in a subroutine called from several places. We want to know, sort of, the whole current state of the program. Also, if that pixel was drawn several times, we want to know about only the last time that that pixel changed.

    Imagine that the image shows cars in the north lot. You select a pixel that's part of the image of a wheel nut. However there are many wheel nuts in the image, perhaps all drawn with the same subroutine. You might want to know that you selected the 4th wheel nut on the right front wheel of the 2nd car on the left of the 3rd row from the front.

    There are various messy methods, which are all now deprecated. The new official way is to use the color buffer to code the objects.

    1. Decide what granularity you want for the selection. E.g, in the north lot, you may not care about specific wheel nuts, but just about wheels. You want to know that you selected the right front wheel of the 2nd car on the left of the 3rd row from the front.
    2. Assign each wheel in the lot a different id number.
    3. When drawing the scene, use each wheel's id number for its color.
    4. Look at the contents of the color buffer pixel to know what you picked.
    5. Perhaps really store this info in a 2nd buffer parallel to the color buffer, so the image will look better.