CpSc 465, Principles of Computer Graphics

Assignment 2

due March 10

Adding Features

In this assignment, you will add features to Assignment 1. If you used SPiGoT, or if you did not finish the first assignment, I will provide you with a working OpenGL program.

Scan Conversion

Replace the OpenGL line-drawing routine (GL_LINES) with Bresenham's Algorithm (GL_POINTS). Your implementation should allow lines to be drawn in any direction.


Add a visible clip rectangle to the display, drawn in a separate color. The clip rectangle should have two visible handles, and the user should be able to resize the clip rectangle interactively. Rubber-band the rectangle in the same manner as the rest of the lines:

Add a menu item that will allow the user to toggle clipping. When clipping is turned on, continue to draw the markers at the end points of lines but do not draw the lines outside the clip rectangle:


Extra Credit, worth up to 25% extra on this assignment
Add another menu item for the user to toggle antialiasing. When antialiasing is turned on, use one of the algorithms discussed in class to smooth jagged lines. Document the algorithm you use.