Assignment 2-- Cohen-Sutherland Line Clipping


This assignment is analogous to Assignment 1. The only difference is that you are asked to implement the Cohen-Sutherland segment clipping algorithm presented in class (and the text). This is the left-hand topic module in the Fusion system.

The point of this assignment is not to have you copy pseudocode out of the book. In fact, just about everyone will get full or nearly full credit for this assignment (assuming you hand it in, of course). The point is for you to learn to write a correct clipping algorithm.

So, leave your notes and text closed; bring a few sheets of paper and something to write with; craft your algorithm from scratch; implement it; and see if it works!

See the Assignment 1 handout for details about the courseware.  As usual, problems should be reported to fusion@graphics.lcs.mit.edu.

Again, Java details can be found in the The Java Language Specification.

Don't Forget:

Clipping lines is fun, and makes them safer.