Categories
3. Generative Thing

Generative Thing – Laura Lachin

LINK TO CODE

For my generative thing, I created a sketch that generates random flowers when the canvas is clicked on. There are three different categories of flowers and each category has two variations, meaning there are six total types of flowers that can be generated. Each flower has a random stem height, stem width, stem color, petal stroke width, petal stroke color, and petal fill color, and two flower categories have a random petal size. To manage unpredictability, I used if statements and the random function. I used both of these to determine which flower type to generate, and I used the random function to determine all colors, except the background color. To manage control, I used the MousePressed function, created my own functions, and created global variables. I created my own functions in order to better organize my code, make the MousePressed function more readable, and make it easier to reuse code, and I created global variables in order to make it easier to change certain numbers, such as the red in RGB, and to make it easier to reuse certain numbers, such as the stem height. Overall, I am happy with my results because my sketch is able to create numerous unique flowers.

Initial Sketch:

Bibliography:

https://editor.p5js.org/brain/sketches/2N3oI7V3x