CMSC 110 (Introduction to Computing)

Assignment#3

Due before start of class on October 3, 2012

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


Task:

Design two objects -- whatever you feel like drawing. For each object, write a function to draw that object of the following form:

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

Insert the name of your object in place of "MyObject" in the function name. Since you are drawing two objects, this will result in two functions, drawMyObject1() and drawMyObject2().

Write a program that draws several versions (at least 3) of each object in a 500 x 500 sketch. 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, or any other properties, each time it is drawn.

At least one of your objects 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:


Requirements:


What to Hand in:

Carefully read the Assignment Submission Policy for how to submit your assignment.