CpSc 465, Principles of Computer Graphics

Assignment 1

due February 17

The Basics

Begin with an empty window. Each mouse click in an empty spot in the window should cause a small marker (e.g., a dot, a square, or an "X") to be drawn. The first click should produce only a marker. Subsequent clicks should mark the spot and add a new polyline segment from the previous point to the new position. The picture below shows an example after the mouse has been clicked six times:

Add a menu item that will allow you to clear the window.

Adding Interaction

Once the functionality above is working, add the ability to drag each marker to a new position. Rubber-band the two line segments connected to the marker being dragged. Clicking other spots in the window should continue to add polyline segments.

Implementation Suggestions