The tutorials about functions and objects inspired me to create a group of small objects that could simulate reality. Inspired by the p5.js-examples-snowflakes, I thought of something I’m really missing- the snow in the Forbidden City. Almost every year in Beijing, China, I would bring my camera to the Forbidden City to catch the snow. The outside dark red wall, green and golden decorations along with antique roofs create a strong sense of royalty. The colors formed a great contrast to the snowflakes, making the scene more than peaceful and pleasant.
First of all, I read and learned the example code for several hours, trying to figure out the functions of each part. Then I left it away and start to make my own version of the movement of snowflakes, based on my comprehension of the example.
Here are two gifs showing different stages of my programming processes:
By adjusting the arguments and adding the background, I finally simulated the snowfall in the Forbidden City with a generally low speed and evenly distributed flakes.
Furthermore, I wanted to challenge myself by adding randomly moving snowflakes. In reality, when you are walking in the snow, some flakes would suddenly hit you and then gradually melt. I wanted to re-create this experience.
The gif below shows the result. I added another array to hold randomly generated special flakes and added functions in snowFlake class to control the special movement and fade out effect.
To view in full screen: Snow in the Forbidden City_ Full Screen
To view the source code: Snow in the Forbidden City_ Code
I watched this project for a long time. For me, it is so comfortable. It releases my anxiety from coursework, financial load, peer pressure and so on. Natural simulation is so attractive!