Computer Graphics- Homework 2

Due : Tuesday October 20, 2015

    Complete EITHER question 1 OR question 2 below.
    1. Rewrite the Sierpinski gasket program from the notes to use the left mouse button to start a single new subdivision (up to a maximum of 8), the right (or middle) button to have it iterate through subdivisions displaying a new one every second until a maximum of 8 subdivisions. Call this program gasket5.
    2. Write a simple paint program paint. This should display a menu of objects that can be painted (lines, rectangles, triangles) and also a menu of colors. The object should be drawn with the currently selected color using vertex data entered by clicking the mouse. Note that you need to enter 2 points for a line or rectangle, and three for a triangle. You should automatically draw the object after the correct number of points are entered rather than having to click on a button to have it drawn.
    1. Modify the program you wrote in Homework 1 to draw the maze, to allow you to guide a rat through the maze. Call this program maze2. You may represent the rat by a simple construct that distinguishes the head from the tail to allow a user to judge the direction. Use the left and right mouse buttons to turn the mouse and the niddle button to move it forward. Also implement key code shortcuts that use keys j, k and l to turn left, move forward and turn right respectively.
    2. In addition modify the program and call it maze3. This version should not permit the rat to move through walls and should also change the color of the track taken by the rat to red.

Warning

This homework is intended as an individual project. You are not permitted to work jointly on it with others.

Submission Process

Instructions for submitting the homework using svn are contained in this file.

If you are using Windows you may be able to use Tortise SVN .



Paul Farrell