CS 110 Introduction to Computing
Project #5: Homage to Jackson Pollack
In this project you will be writing something like the homage to Mondrian that we did in class earlier this semester. However, this time the homage will be to Jackson Pollack. In particular, you will be using for and while loops to implement an applet that does something like Pollack's spatter paintings.
The interface to this applet should have two buttons -- one named "more spatters" and the other "restart". When you enter the applet, all you should see is a blank screen. Hit the more "more splatters" button and a single splatter will appear. Hit it again, more splatters (the rate of splatter increase is up to you), ... Note that it is OK for every button hit to result in a completely new splatter painting, indeed we have not yet covered in class how you might do anything else.
Hit the "restart" button and you are back to an empty canvas (i.e., no splatters).
Here are some example images from my reference implementation.
For this assignment, please use the following definition of a spatter.
A splatter is:
- A sequence of filled circles
- the sequence has a starting point
- the sequence travels away from the starting point in a straight line.
- the largest circle is at the starting point
- circles moving aways from the starting point get smaller in a steady progression.
Use showStatus (described in lab 5) to show the number of spatters on your painting.
For full credit, splatters should:
- be able to start in any location in the applet,
- move in any direction from the starting location
- have the initial splatter have a starting size that might be different from every other splatter but is certainly greater than some number M and less than some other number N. For example, in my reference implementation M is 15 and N is 100. (As you get lots of splatters it will be impossible to make sure that every splatter has a different initial size (there are only 85 possible initial sizes in my reference implementation).
- have splatters get smaller a different rates for each splatter
- have a different color from any other splatter
- not draw beyond the edges of the applet.
Hint -- you will need to use random numbers a lot. However, I recommend that you begin by just getting one splatter that meets the definition above (without any random numbers) to appear in your applet.
Due Date: November 2, at the beginning of class.
Submit:
- A printout of the code for your applet. (See instructions on the
class website for getting a good looking printout )
- One printout of the applet, showing your prettiest splatter pattern. Note that there are lots of choices in the way splatters are drawn that affect how nice the overall pattern looks, so you may need to spend some time changing parameters within your program to obtain a good looking splatter drawing. (For example, you might decide that an initial size of 100 is way too big for your splatters.) You will be printing them out in black and white so something will get lost, but ... A small portion of your grade (5 points) will be based on my "art critic" eye. I will sort all of the the images in order of my preference, the top five will get 5 points, the next 5 will get 4 points, etc.
- The URL of the HTML page containing your applet
Notes
Recall that you can obtain the size of an applet by putting the
following into your paint method:
int appX = (int) getSize().getWidth();
int appY = (int) getSize().getHeight();
Also recall that to get a random number between 40 and 100 you can use code like the following:
(int) (Math.random()*60 + 40)