Interactive Computer Graphics - Assignment 3

Interaction, Windows, Menus and Animation


Make the following modifications to Assignment 2:

  1. Enable double buffering.

  2. Create a main window with the "black & white" square

  3. Place an ellipse in a SubWindow of the main window. Set the sub-window's display function to draw the background a different color.

  4. Create a menu on the sub window only that allows the user to change the subwindow's background color.

  5. Draw a circle and triangle, which have the same color, in a separate window entitled “window 2”. Allow the user to change the color of these objects by typing a key, 'r' - red, 'g' - green, 'b' - blue, 'y' - yellow, 'o' - orange, 'p' - purple, 'w' - white.

  6. Animate the shapes using the idle function as follows:

    1. Make the squares rotate counter clockwise.

    2. Make the triangle rotate clockwise.

    3. Make the circle increase in size and then decrease in size as though it was “breathing”.

  7. Create a menu for the main window that is right-click activated with the following layout:

        Stop Animation
        Start Animation
        Square Colors ->

    Where each button does the indicated action.

  8. (Extra Credit) Alter the main window so that if a user clicks on it with the left click button, a new "breathing" circle with a random color appears where s/he clicked.

        Movie of HW3 in action (almost). Does not exactly represent specification.

Your program must print to the console what it does and how to use its interface. 2 points will be subtracted from the assignment's grade if this is not included.

Grading Scheme

  1. Double buffering: 0.5 point
  2. Main window with squares: 1 point
  3. SubWindow: 1 point
  4. SubWindow menu: 1.5 point
  5. Second window: 1 point
  6. Second window input: 1.5 point
  7. Animations, including start & stop: 2 points
  8. Main menu: 1.5 points
  9. Adding circles: 2 points

Last modified February 11, 2016.