Screenshot 2024-10-22 at 5.23.49 AM.png

I was interested in the idea of simulating gravity and also wanted to use circular shapes since in my last sketch I struggled with finding the boundaries of ellipses.

There are two main behaviors: snowfall outside the globe, and snowfall inside.

In a particle system, each snowflake has a unique path until it goes into the snowglobe.

breakdown of the Snowflake class

Screenshot 2024-10-22 at 6.09.52 AM.png

the lines with borders are used for the gravity effect

Screenshot 2024-10-22 at 6.11.07 AM.png

regular snowfall

checking if any falling snowflakes touched the globe

this.posX is constantly updated with the time-based variable angle

→ this.initialangle was defined in the constructor with random()

this.posY incremented depending on the size of snowflake

Screenshot 2024-10-22 at 6.11.56 AM.png

sin paths of the snowflakes

Screenshot 2024-10-22 at 6.12.05 AM.png

snowfall within the globe

Screenshot 2024-10-22 at 6.12.17 AM.png

vertical velocity is incremented with gravity constant (0.03).

finding the boundaries of the globe with atan2(), relative to mouse position, which is the center of the globe.

this.VelX is updated according to the found angle above.

the circular shape depicts the simultaneous X and Y cosine paths.

draw() loop

for a more dynamic effect, i had random amounts of snow generated per frame

Screenshot 2024-10-22 at 6.12.27 AM.png