CS 4204: Computer Graphics


Announcements & syllabus


Programming assignments





Homework assignments are due by class time on the due date given (unless otherwise specified). The preferred method of turn-in is via email to the TA. However, if you must write out your answers by hand, homeworks may be turned in at class.

Homework assignments will be listed below as they are assigned.

Homework 2:

Assigned: February 1

Due: February 5, by class time (2:00 PM)

Practicing 2D and 3D mathematics for graphics

Answer the following questions completely, on paper (turned in at class) or in an electronic document (emailed to the TA). Please make sure that the final answer to each question is clearly indicated.

1. Page 144 in the textbook, practice problem 4.3.1.

2. Page 144, practice problem 4.3.3.

3. Page 150, practice problem 4.4.2.

4. Page 171, practice problem 4.6.3.

5. Vector v = (4, 1, 3). Find a vector orthogonal to v with a magnitude of 5.

6. How far is point P = (1, 1, 1) from the plane passing through the points (0, 0, 0), (4, 3, 1), and (6, 2, 7)?

7. Vector u = (7, 3, -2). Find two vectors that are orthogonal to u that are also orthogonal to each other.

8. Give the parametric form of the line passing through the points P = (1, 2, 3) and Q = (6, 5, -1). What point is 75% of the way from P to Q?

9. Find a 2x2 matrix M that, when multiplied with a point P = (x, y), results in the point (y, x).

10. Find a 3x3 matrix N that, when multiplied with a point P = (x, y, z), results in the point (2x, 3y, 4z).

Homework 1:

Assigned: January 24

Due: January 29, 11:59 PM

Your first openGL program

Using the code examples given to you as a starting point, write a simple openGL program. The program should initially display a blank 500x500 pixel window with a black background. When the user clicks the left mouse button the first time, a small white square should appear at the location where the mouse was clicked. Each subsequent left mouse click should also place a small white square, and should connect the last point to the current point with a white line segment (allowing the user to create a simple drawing consisting of connected lines).

You should also provide a menu, accessed with a right mouse button click, that allows the user to:

a) undo the previous line segment (you should allow the user to undo as many segments as they want),

b) change the color (of the entire drawing) to red, green, blue, or white, and

c) clear the screen to start over.

Turn in your source code only by email to the TA no later than 11:59 PM on Tuesday, January 29.