Objects are 2D polygons and made by ``rubber banding''. Interactions should be with the left mouse button. A left mouse down action deposits a point (a vertex of the polygon) at the mouse location. Draw a rubber band line between the last vertex entered and the next vertex. The next vertex position will be wherever the left mouse down action is detected. To close the polygon, you need to detect a left mouse double-click action. The first vertex and the last vertex are then connected. This will produce a closed polygon. Specify polygon fill (look up glPolygonMode). Does OpenGL let you have self-intersecting polygons?
All objects that have been created should be maintained by the program. They are drawn from oldest to most recent, so that the most recent object created can overlap (partially or completely) older objects.
This command should work from unix.ic.ucsc.edu. Create and submit a subdirectory called prog2. It should contain the executable and all the files you have to make your program compile/run. Tar or zip up prog2 before submitting.
Last modified Saturday, 03-Oct-2009 14:03:23 PDT.