## COM1370 Computer Graphics -- Midterm Exam -- Wednesday, July 25th

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

Question 1.

Assume that a CLUT has a three-bit RGB color index and a three-bit color output. Draw the CLUT elements that would lead to the production of output color codes that are complementary to the input, e.g, Red in would produce Blue + Green out.

Question 2.

Below are shown the 3D rotation matrices for 90-degree rotations around the y and z axes.

Compute the two different matrices Rz x Ry and Ry x Rz. These should be different. Use each of the resultant matrices to transform the point x=1, y=z=0 and show that the point is transformed differently by the two matrices.

Question 3.

Write out the algebraic details of the DDA algorithm for line drawing. Be clear which values need to be floating point and how integer values would also be involved.

Question 4.

Show in step-by-step diagrams how the Cohen-Sutherland algorithm would clip the following line. Explain at what stage the line endpoint labels are switched and at what stages the region codes are used in the decisions. You do not have to list the actual binary region codes. Just describe at what stage you used them to make decisions and what those decisions were. Use the order Left, Right, Bottom, Top. Hint: You will only need to switch endpoints once -- don't jump back and forth.

Question 5.

Describe how traversing the following triangle results in the construction of a new clipped polygon, according to the Sutherland-Hodgeman algorithm. Clip only against the right-hand edge of the window. You are not expected to know each rule for creating and dropping points, but show that you understand the basics of the idea.