CPSC5125 - Assignment 3 - Fall 2014 Drawing Polygons: Description
CPSC5125 - Assignment 3 - Fall 2014 Drawing Polygons: Description
Drawing Polygons
Description
Due Date: Sunday October 12
th
, 2014 by 11:55 pm.
Objective
The third assignment is to create a very simple drawing program that allows
the user to interactively create and edit some polygons on the screen. I will
explain more details on the next video.
Assignment
The layout of the application is shown in Figure 1. On the left there should be
some pictures drawn. On the right there should be a long rectangle. The user
should be able to do the following:
Click on a polygon on the left to start creating a polygon.
For the triangle, the rst and second clicks should indicate where the rst
and second vertices should go. The third click should nish the triangle.
For the rectangle, the rst click should indicate one of the corners of the
polygon and the second the opposite corner.
For the circle, the rst click should indicate the center of the circle and
the second where the circumference of the circle. The distance between
both clicks should be the radius of the circle.
Using a menu system, you should be able to choose the color for the
drawing from at least 5 colors.
Using a menu system, you should be able to select translation, rotation or
scaling. If translation is selected, the next click should indicate where to
move the center of the polygon. If either rotation or scaling, clicking on
the rectangle on the right should apply a relative amount of rotation or
scaling to the polygon. The top part of the rectangle should be close to 0
in the scaling and the bottom should be 10. The top part of the rectangle
should be 0 degrees for rotation whereas the bottom part should be 360
degrees.
Graduate Students
You should also implement the free drawing tool (bottom rectangle.)
1
Figure 1: Application Layout.
For triangles, your last click should be able to temporarily draw the trian-
gle and while you do not release the button allow it to change. Releasing
the button will then set the last vertex.
For rectangles, your last click should behave similar as described for the
triangle.
The drawings on the left should change color to provide feedback on which
choice you made.
Deliverables
Please, turn in the zipped project folder. Dont use other compression formats
such as rar or tar.
2