Project 3-GenerativeLanscape

Evening Sky

link: https://www.openprocessing.org/sketch/622613

For this project, I generate a evening sky with pink cloud, sun, meteor and buildings. The cloud and sun moves randomly in the sky. The color of sky and windows changes over time. 

The main generative landscape is the cloud, and it was quite challenging to show it. So I chose to deal with the buildings and background first. When I look at photographs of evening sky, I noticed the color of sky tends to much lighter when close to the Sun. As a result, I decided to use for loop to draw lines on entire screen, and when y-position of lines gets bigger, which means lines are at the lower place of the screen, the transparency of line would be smaller, so that the color would be lighter. In draw(), I set the background as pink. Consequently, it looks like the sky change from blue to pink as a whole. To add a more variation to this landscape, I use random function to let the color of windows and sky changes. 

The technique about transparency in sky color inspired me. Maybe I can use similar technique to display the texture of  cloud. Basically, I use loops to draw triangles on the entire canvas, and then let each one have random transparency. Since noise function gives a much smoother sequence than random() does, I use 2D noise to control the opacity of color. I wrote the cloud function, and var A is my 2D noise variable. In order to add a 3D effect on the texture, I also applied var A, noise variable, into the satisfaction of color. As a result, when A is closer to 1, both the opacity and satisfaction of cloud is higher. 

In addition, I add a sun and a meteor in the sky to show more motions. Sun is moving based on noise variable, and the meteor is falling at same speed, starting at random X value.