COM 1370 Computer Graphics - Summer 2001 - Assignment 4

Professor Futrelle -- College of Computer Science, Northeastern U., Boston, MA

ASSIGNMENT DUE END OF FRIDAY, JULY 27th

Updated Satruday 7/21/2001


This assignment is due electronically by the end of the day (midnight) Friday, 7/27. Remember, turn in whatever you have done by that time.

IMPORTANT ADDENDUM, SATURDAY 7/21/01:

This note overrides some of the notes after it, in the original assignment, which is still on this page, at the end. Read and compare the two carefully.

A student asked, in the form mailer:

   "04-message-text" -> "Hello prof.  For com1370 assignment 4
   Part 1, what do we rotate the triangle around? Do we make
   three triangles and rotate them around x-axis, y-axis etc?"

The answer is that this student needs to read the directions more carefully but I also need to clarify them. I did promise in class that I'd clarify this assignment. The transformations must be done carefully for everything to work. The clarifications follow:

A little thought reveals that we cannot construct a single composite matrix that does a slight rotation around each axis and then translates. Because each time we apply this matrix, it will cause the points to translate *again*. To understand this, say the rotation matrices were all unit matrices. Then the composite matrix would just be a translation. If we updated the points with this composite they'd move away from the origin, say by 200 pixels in each axis. If we applied the matrix again to the updated points, they'd then be moved a total of 400 pixels, then 600 etc., and soon leave the screen.

There are two ways to proceed to do it right. Both work.

1. Create the triangle at the origin. Each time the rotation matrices are created, increase the angle passed to the constructor to a larger value, using an angle = someSmallAngleValue * t, where t is the number of steps in your timing loop. Then multiply these together, followed by the translation matrix and multiply the points in the triangle at the origin by it. Do not change the point values in the triangle, just produce three new points as transformed. Use only the x,y values from these new points to draw the polygon on the screen.

or,

2. Create a triangle in the middle of space, say around point 200,200. Create a matrix once that does the following: First translate to the origin, using -200, -200. Then rotate with three constant rotation matrices each through a small fixed angle, different for each of the three. Then translate back, +200, +200. This entire composite matrix is constant and unchanging, so you only need to compute it once. But you must update the points in the triangle each time so they change, unlike option 1.


Original form of the assignment -- most of it stil applies.

Overview

This is a two-part project. This is part 1. This part will consist of rotation of a single triangle in three dimensions. The second part, due Tuesday, August 7th, will deal with a "solid" object, a polyhedron tumbling in space.

Do the following for a basic C grade. (An excellent job on this part could get you more than a C, e.g., a clean and clear and well-organized and commented system.)

For a higher grade:

For the highest grade:

See the page on electronic handins for the correct way to set up your directories and files for your electronic handins.


Go to COM1370 home page

Return to Prof. Futrelle's home page