CMSC 110 (Introduction to Computing)

Assignment#3

Due before start of class on Thursday, September 29, 2011

First, read Chapters 1, 2, 3, 4, 5, 6 & 7 from Shifman's text.


Task:
Design an object. This could be whatever you feel like drawing. To draw your object, you should use the following function:

void drawMyObject(float x, float y, float objectWidth, float objectHeight) {
...
}

Insert the name of your object in place of "MyObject" in the fuction name.

Write a program that draws several versions (at least 3) of the object in a 500 x 500 sketch. You should use the random number function to generate x, y, objectWidth and objectHeight values, so that the sketch changes each time it is run. You can also vary the coloring of the object each time it is drawn.

Your object must interact with the mouse in two manners: 

  1.  Based on the position of the mouse.  You can design this interactivity however you like, but here are some ideas to get you started:
  1. Based on when the mouse is over the object.  Again, you can design this however you like, but here are some ideas:

While you may have an object that follows the mouse (i.e., is drawn at a location based on mouseX and mouseY), you cannot count this toward either of the two interactive components.

Pay special attention to the aesthetic aspects of your design as well as interactivity.  Your sketch should be creative!!


Hints:


What to Hand in: