Assignment 1


Simple Drawing Program


The objective of this assignment is build a simple OpenGL drawing program that interactively draws simple houses at locations on the screen designated by the mouse. The houses will consist of two parts: a lower rectangular part and a triangular roof.   The user may independently select the color of the house and its roof..  When the program starts, the window should be cleared to black.  To draw, the user moves the mouse to the desired location of the house. A left click at this location will draw the house.

In order to retain the houses previously drawn, some form of data structure will be required.  It will be necessary to redraw all of the previously drawn figures every time the current figure is redrawn.

It will also be possible to select the background color, clear all drawn figures, and terminate the program.

Requirements:

1. Initially the screen will be cleared to black.

2. A menu will be provided which allows the selection of the color of the house from among the set (red, green, blue, cyan, magenta, yellow).

3. A menu will be provided which allows the selection of the color of the roof from among the set (red, green, blue, cyan, magenta, yellow).

4. A menu will be provided which allows the selection of the color of the background from among the set (black, white)

5. Moving the cursor with the mouse and clicking the left mouse button will draw a house at that location.

6. Resizing the screen will redraw all of the items scaled to fit the new screen size.

7. All items should be properly redrawn if the window is obscured and then exposed.

8. A menu item will clear the screen to the background color.

9. A menu item will terminate the program.

For extra credit, provide a means for scaling the size of each house drawn.

Therefore there should be a high level menu attached to the right mouse button has five entries:
 

The color selection menus will have appropriate submenus.

Questions?

Submittal


Assignment 1 is due March 8, 2011 .  Source code should be submitted by email.  Assignments that are one week late will receive two thirds credit.  Assignments that are two weeks late will receive one half credit. Submission should be in the form of a well-commented source code, preferably written in ANSI C. C++ is also acceptable. It is expected that students will use OpenGL and GLUT for this assignment.

Academic Honesty


I expect all code submitted by students in this course to be their own. In exceptional circumstances, it is permissible to borrow appropriate small sections of code from other authors. Whenever this is done, the student must provide appropriate reference. References must include the author of the code and a location that I can use to check the source. Submissions that include copied but unreferenced code will receive zero credit.


Return to 91.546 Home Page