top of page

week 6: generative art

  • Writer: Rachelle Vassoler
    Rachelle Vassoler
  • Oct 12, 2022
  • 1 min read

for this assignment we had to create our own generative art using the random function


we were introduced to the concept of random generation and learned new code to create an art piece with

variable = random timer 1

x = random timer 2

y = random if, else

frameRate(); mousePressed();


I decided I wanted to create a night sky with mountains, a moon, and stars. I wanted the stars to be randomly generated in the sky, but I wanted two different kinds of stars that generated at different frame rates.


You cannot have two frameRate(); commands at the same time, so I looked into having two separate timers and assigned each variable to the different kinds of stars.


I used the ellipse(); command to create small white dots and used the beginShape(); function to create a star shape. I also wanted the star shapes to change colors when the mouse was pressed, so I implemented that into my design as well.


I also wanted the moon to appear once the mouse was pressed, so I made sure to have those functions happen all at once.


To create the moon shape, I overlapped a black ellipse on top of a blue one, creating the illusion of a moon against the black sky. I used the triangle function to create the mountains.


my code:

finished project:


Comments


©2023 by rachelle vassoler

bottom of page