# CG notes about grading, Wed 2016-12-21

When computing the total grade, I followed the syllabus, except for lowering some of the letter grade cutoffs. The reason is that I felt that the class had earned higher grades. The new cutoffs are:

>=91.0% A
>=87.0% A-
>=83.0% B+
>=79.0% B
>=75.0% B-
>=70.0% C+
>=65.0% C
>=60.0% C-
>=55.0% D+
>=50.0% D
>=0% F

I enjoyed teaching the class, and hope that you enjoyed taking it. Comments about how to improve it are welcome.

I am available in the future, including after you graduate, to talk about any legal ethical topic.

I wish you success in the rest of your time at RPI, and after.

# CG ECSE-4750 Computer Graphics Final Exam, RPI, Thurs 2016-12-14

Name, RCSID:

.

.


Rules:

1. You have 180 minutes.
2. You may bring in two 2-sided 8.5"x11" papers 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 25 questions. Check that your copy of this test has all the pages.

Questions:

1. (2 pts) Put these graphics pipeline components in the correct order:

2. primitive-assembly
3. rasterizer
.

.

2. (2 pts) Name an advantage and a disadvantage of standards.

.

.

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

.

4. (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}$

.

.

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

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

.

.

6. (2 pts) There is an aliasing problem when raytracing objects that are so small that one ray sent through the center of a pixel might go to the left of the object, and the next ray, through the center of the next pixel, go to its right. Give two ways to modify ray tracing to lessen this problem.

.

.

7. (2 pts) Consider a 2D cubic Bezier curve with control points (0,0), (1,1), (2,2), (3,3). What is the point at t=0.5?

.

.

8. (2 pts) Describe what the curve in the previous question looks like.

.

.

9. (2 pts) Bezier curves do not generally go through the their control points, except for the first and last control points. It would be quite easy to design a curve fitting system so that the curve goes through all the control points. However the CAD community has decided that they don't want this. Why?

.

.

10. (2 pts) When designing a curve with many control points, the CAD community has decided to use a sequence of low degree curves instead of one high degree curve. Give two reasons why.

.

.

11. (2 pts) In a fragment shader, a sampler2D does something more than a simple array lookup like you have in most programming languages. What?

.

.

12. (2 pts) Tell me about view normalization. What is it? What is good about it?

.

.

13. (2 pts) Is ray tracing an object-space or an image-space algorithm?

.

.

14. (2 pts) The last big update in the OpenGL standard removed many things from the standard. Name two things that we've discussed in class that we now have to implement ourselves if we wish to use.

.

.

15. (2 pts) Give two reasons why OpenGl removed many things from the standard.

.

.

16. (2 pts) What rotation does the quaternion k represent?

.

.

17. (2 pts) Consider this 2D homogeneous point: (2,3,4). Translate it by 1 in the x direction. What is the resulting point, in a Cartesian representation?

.

.

18. (2 pts) What is the 3x3 2D homogeneous matrix for a translation by 1 in the x direction?

.

.

19. (2 pts) Here are two possible ways to calculate the color of each pixel of a curved triangle: 1) Compute the color at each vertex of the triangle, and then interpolate the color. 2) Compute the surface normals at the vertices, interpolate the normal at each pixel, and use that to compute the color.

Method (2) produces more realistic lighting. Give one effect that it can render that (1) cannot.

.

.

20. (2 pts) Describe what bump mapping is, and tell why it is useful.

.

.

21. (2 pts) Compute the projection equations when the viewpoint is at (0,0,0) and the projection plane is 3x+2y+z=4. Use Cartesian coordinates. You do not need to put the result into a matrix form, but simplify your result as much as possible.

.

.

22. (2 pts) Using homogeneous coordinates for spline control points gives the designer an extra tool. What happens to the curve when the designer changes the weight in a homogeneous control point?

.

.

23. (2 pts) What is Constructive Solid Geometry?

.

.

24. (2 pts) Why are the Bresenham line and circle drawing algorithms less useful now?

.

.

25. (2 pts) What texture mapping problem does the mipmap solve?

.

.


End of final exam

# CG notes before final, Tues 2016-12-13

1. All the iclicker questions: part 1, part 2, part 3, part 4.

2. Handwritten notes from 12/05.

3. The following iclickers are being used in class but have not been registered. If one of these is yours, write me (again); last chance.

#3B96FF52 #3BC29861 #3BE21EC7 #42221F7F

# CG Lecture 34, Thu 2016-12-1

1. Handwritten notes from 12/01.

2. My spring ECSE-4740 Parallel Computing course now also has a 6000-level version. It will be listed on SIS soon.

Grad students might prefer this version. The two courses will meet together. The grad version will require more work.

3. This Wed, 2016-12-07, I will present no material. This will be an optional session for you to ask me questions.

However, does anyone want more new material? Well, I'm a professor and I do like talking.

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

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

If one of these is yours (and you wish for iclicker credit), then please email me with your iclicker serial, and your name and RCS id.

5. Today and Thurs, Shama will show the 2-minute videos that you sent her.

Videos over 2 minutes will be truncated at 2 minutes.

6. Concerning getting an incomplete grade and finishing later: RPI has strict rules for this that make it very hard to get. Being too busy is not an acceptable reason.

7. Final exam:

There will be a final exam on Wed Dec 14, 11:30-2:30 in DCC (aka CC, aka Darrin) 318.

If you have a conflict, please tell me this week, and name the conflicting course. It must be a course listed in the final exam schedule that you are officially registered in.

You may bring in two 2-sided 8.5"x11" sheets of 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. The final exam will contain material from the whole course, but more from the last half.

Final exam questions F2014 with unused questions and some answers.

# CG Lecture 33, Thu 2016-12-1

1. Handwritten notes from 11/30.

2. That project I was on about levee modeling in a centrifuge with a kinect got into Inside Rensselaer.

My personal view on the New Orleans levee failure: Officials in New Orleans didn't believe that anything that bad would actually happen. So there was an official state disaster preparation exercise the year before showing the possibility, but who believes these things? Some towns across the river did. They maintained their levees on their own w/o waiting for assistance. They didn't make the news (because they weren't flooded).

3. Next Monday will be a review.

4. Next Wed I will present no material. This will be an optional session for you to ask me questions.

However, does anyone want more new material? Well, I'm a professor and I do like talking.

5. Next Thurs, Shama will show the 2-minute videos that you sent her.

6. Examples of computations with ray tracing.

1. Intersect the parametric line x=y=z=t with the plane x+y+z=1.
2. Intersect that line with the plane z=0.
3. Reflect that line off the plane. The line is coming from above.
4. Intersect that line with the sphere $(x-5)^2+(y-5)^2+z^2=1$.
5. Intersect that line with the sphere $(x-5)^2+(y-5)^2+(z-5)^2=1$.
7. Radiosity sample computation. The scene is two parallel planes. Each plane reflects 50% of the incoming light onto the other plane. The first plane is also emitting one unit of light.

8. More detail on the programs drawing the Utah teapot.

# CG Lecture 32, Wed 2016-11-30

1. Iclicker questions.
2. Handwritten notes from 11/28.
3. How to find a point on a cubic Bezier curve by hand.
4. How to subdivide a cubic Bezier curve into 2. That is, given the 4 control points of one curve, find the 4 control points of 2 curves that together match the original curve.
5. How to hand-draw a cubic B-spline from a control polygon. It's really quite simple, which you wouldn't guess from most of the texts on splines.
6. 15_2 Ray tracing.

# CG Lecture 31, Mon 2016-11-28

1. Iclicker questions.
2. If anyone wants to show the video to the class of Monday instead of Thurs, could you please write Shama (even if you filled out the LMS survey).
3. Handwritten notes from
4. There are many interactive spline demos on the web. Bayreuth is good. Try the following:
1. Moving a control point moves only a few segments.
2. If you make control points coincide then the continuity at that joint falls.
3. You can make the curve have a kink. At that point, there is still parametric continuity, but not geometric continuity. That is, $dx/dt$ and $dy/dt$ are continuous but $dy/dx$ is not.
5. ibiblio shows the problem with interpolating a high degree polynomial. The curve swings wildly and it's notintuitive.
6. Khan Academy shows some code. See how it decides which control point you clicked on.
7. Programs drawing the Utah teapot.
8. 14_2 Designing parametric cubic curves.
9. 14_3 Bezier and spline curves and surfaces.
10. 14_4 Rendering curves and surfaces.
11. 14_5 Rendering the teapot.
12. You do not need to learn most of those slides. Later I'll summarize what you need.
13. 15_1 Global rendering.
14. 15_2 Ray tracing.
15. 15_3 What's next?.

# CG iclicker questions 4

1. What is happening in the following code that is part of a picking program that we saw (11_4):

if(i==0) gl_FragColor = c[0];
else if(i==1) gl_FragColor = c[1];
else if(i==2) gl_FragColor = c[2];
else if(i==3) gl_FragColor = c[3];
else if(i==4) gl_FragColor = c[4];
else if(i==5) gl_FragColor = c[5];
else if(i==6) gl_FragColor = c[6];

1. This assigns to each pixel the number that we'd like returned if the user clicks on that pixel.
2. This assigns to each pixel the true color of that polygon.
3. This keeps track of how many times the user clicked on that pixel.
4. This notes how many vertices that polygon has.
5. This notes the shininess exponent for that face.
2. Radiosity is better than ray tracing when the scene is all

1. diffuse objects
2. objects outside the viewing region
3. objects that are very close to the viewpoint
4. specular objects
5. very small objects
3. Ray tracing is better than radiosity when the scene is all

1. diffuse objects
2. objects outside the viewing region
3. objects that are very close to the viewpoint
4. specular objects
5. very small objects
4. Firing multiple rays through each pixel handles the problem of

1. diffuse objects
2. objects outside the viewing region
3. objects that are very close to the viewpoint
4. specular objects
5. very small objects
5. Consider a 2D Cartesian cubic Bezier curve with these control points: (0,0), (0,1), (1,1), (1,0). What is the point at t=0? OK to look up the formula.

1. (0,0)
2. (0,1)
3. (1,0)
4. (1/2, 3/4)
5. (1/2,1)
6. What is the point at t=1/2?

1. (0,0)
2. (0,1)
3. (1,0)
4. (1/2, 3/4)
5. (1/2,1)
7. What is the point at t=1?

1. (0,0)
2. (0,1)
3. (1,0)
4. (1/2, 3/4)
5. (1/2,1)
8. If you interpolate a curve through a list of control points instead of approximating a curve near the points, then what happens?

1. It will not be possible to join two curves and match the radii of curvature.
2. The calculations to compute the curve will take impossibly long.
3. The curve will stay within the convex hull of the control points.
4. The curve will swing outside the convex hull of the control points.
5. This isn't possible for curves of odd degree.
9. If you use quadratic Bezier curves, then what happens?

1. It will not be possible to join two curves and match the radii of curvature.
2. The calculations to compute the curve will take impossibly long.
3. The curve will stay within the convex hull of the control points.
4. The curve will swing outside the convex hull of the control points.
5. This isn't possible for curves of even degree.

# CG iclicker questions 3

No questions from slide sets 9_5, 10_1, 10_2 (we spent enough time on those topics).

1. When you add many images together to blend them, there may be problems: (10_3)
1. Loss of accuracy if each color has only 8 bits.
2. You can't do this at all in WebGL.
3. This requires using a color buffer of at least 4096x4096.
4. This requires a stencil buffer.
5. This requires that the A component be set to 0.0.
2. Fog has been removed from OpenGL, and is not in WebGL, because: (10_3)
1. The several possible fog factors (linear, exponential, gaussian) were too confusing.
2. With cleaner air, we no longer want to model smog.
3. It executed too slowly.
4. Removing it simplified the standard, and anyway you can implement it yourself.
5. It wasn't removed; it's still part of WebGL.
3. What does sampler2D do? (10_4)
1. Return a sample random variable from a probability distribution.
2. Return one specific texel from a texture map.
3. Return a point on a bezier curve by interpolating control points.
4. Interpoint a texture value from nearby texels.
5. Compute a phong-shaded color.
4. Rendering a scene by computing which pixels are colored by each object is called (12_5)
1. Image space approach
2. Modelview space approach
3. Object space approach
4. Pixel space approach
5. Viewport space approach
5. Rendering a scene by computing which objects are behind each pixel is called (12_5)
1. Image space approach
2. Modelview space approach
3. Object space approach
4. Pixel space approach
5. Viewport space approach
6. Cohen-Sutherland clipping (13_1)
1. Clips faces fast by doing concave faces properly.
2. Clips faces fast by normalizing the projection first.
3. Clips lines fast by eliminating many simple cases quickly.
4. Clips lines fast by using the fact the current CPUs do division fast.
5. Clips textures fast with a mipmap.
7. View normalization (13_1)
1. Makes the clip region into a cube but changes object cubes into parallelepipeds.
2. Preserves angles and distances.
3. Preserves angles but not distances.
4. Preserves distances but not angles.
5. Was obsoleted by fast CPUs.
8. About polygon clipping: (13_2)
1. A polygon might gain vertices.
2. A polygon might gain area.
3. If a polygon's vertices are all outside the clip region, then it may be deleted.
4. Using a 6-stage pipeline keeps the latency the same.
5. Concave polygons become convex.
9. From his profits from SGI, Netscape, and other startups, Jim Clark bought the world's XXX largest yacht.
1. 1st
2. 2nd
3. 3rd
4. 4th
5. 5th
10. Which hidden surface algorithm sorts objects back-to-front? (13_2)
1. BSP tree
2. depth (Z) buffer
3. image space
4. painter's
5. scan line
11. Which hidden surface algorithm preprocesses objects into a tree so that you can change the viewpoint and then render by traversing the tree in a different order? (13_2)
1. BSP tree
2. depth (Z) buffer
3. image space
4. painter's
5. scan line
12. Which hidden surface algorithm might send its output straight to a display like a CRT w/o ever storing the whole image? (13_2)
1. BSP tree
2. depth (Z) buffer
3. image space
4. painter's
5. scan line
13. Some colors that you can see on your display cannot be printed, and vv. Why? (13_4)
1. Purple is not a pure spectral color.
2. The UV emitted by the display fades the printer paper.
3. The display and printer's gamuts don't match.
4. The printer has 4 inks but the display only 3 primaries.
5. There's no such thing as a standard display - different manufacturers have different notions of red.

# CG Lecture 30, Mon 2016-11-21

1. I still have an Oculus Rift DK2, if anyone would like to borrow it. It's a little old but may be interesting.
2. The dead links in Lecture 29 should be ok now.
3. Raytracing jello brand gelatin.
4. Iclicker questions.
5. Programs drawing the Utah teapot.
6. 14_2 Designing parametric cubic curves.
7. 14_3 Bezier and spline curves and surfaces.
8. 14_4 Rendering curves and surfaces.
9. 14_5 Rendering the teapot.
10. You do not need to learn most of those slides. Later I'll summarize what you need.
11. 15_1 Global rendering.
12. 15_2 Ray tracing.
13. 15_3 What's next?.