NOC-Week 3: Raindrops-Vectors (Lily)

I used vectors and OOP to create raindrops in this sketch.

Instead of using X and Y positions as separate variables, I created vectors for the position, the velocity, and the acceleration for each raindrop object. The acceleration is used to simulate the raindrops in real life.

In terms of the background, I used what Prof. Moon has talked about in his workshop last week to make the color change gradually from blue to pink.

When the user presses the mouse, the rain will slowly stop dropping and stay in the air, just like when time stops in those sci-fi movies.

Also, I wanted to create another interaction that allows the user to use the mouse to drive away the raindrops. But I have not managed to finish it by the time I am writing this documentation.

Here is a link to what I have accomplished so far. I will update it as soon as I finish tackling the problem.

https://editor.p5js.org/py561@nyu.edu/sketches/7whgW_611


Updated:

Eventually, with the help of Dave, I managed to debug and found that the reason why it did not work out earlier was that I made a mistake while translating the raindrops. I should put “line(0, 0, 0, length)” instead of “line(posX, 0, posX, length)”.

Leave a Reply