Assignment 3: Object Oriented Programming(Rain)

In this assignment, my idea was to create a generative artwork that simulates rainfall and rainy clouds.  The inspiration was from the falling ball example in class. I asked myself if there was a way to add meaning to the falling balls and I immediately thought of rain and snow.

My implementation of the assignment uses shapes, sound, an image background, gravity, and  noise . I created a class for raindrops and clouds. The collection of raindrops produces the rain. At first I tried to make the cloud class inherit from the raindrop class. I tried this because I wanted each individual cloud to produce rain by itself. However my approach did not work as intended so I made the rain exclusive from the clouds while making the raindrops start at the y position of the clouds.

I also tried to include wind in the rain. I initially used the noise to simulate the wind but it became difficult to control the direction of the rainfall so I mapped the the y position of the mouse to an interval and added it to the raindrop coordinates. This way changing the mouse position will change the direction of fall thus creating the illusion of wind in a particular direction.

I tried to also add parallax to the raindrops but it didn’t work quite well so I played with the stroke weight of the raindrop to make some raindrops appear closer than others.

By clicking on the sketch you can make it rain or not.

The embedded code:


Future improvements will focus on adding  an umbrella to the mouse’s movement and blocking off the raindrops from the area the umbrella occupies. Furthermore, lightening bolts and thunder sounds will be randomly added to make the simulation close to actual rain.

One thought on “Assignment 3: Object Oriented Programming(Rain)”

  1. Fun! I agree adding an umbrella or something at the mouse position would add a lot. It’s quite an abrupt change when you click the mouse – to make the transition smoother you could let the existing drops keep going (and maybe you could slow down the rate of rain drops before stopping completely) and fade out the audio. Good progress, overall great!

Leave a Reply