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.
the lines with borders are used for the gravity effect
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
sin paths of the snowflakes
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.
for a more dynamic effect, i had random amounts of snow generated per frame