assignment 2 – generative art: a flower bed

Concept:

I was introduced to the phenomenon of Perlin noise from one of the readings in class. I looked deeper into it, and I kind of fell into a rabbit-hole where I was googling the sort of things one could generate using this property. Always a fan of vaguely spherical shapes, I used the noise to make distorted spheres. While playing around, I noticed that from above it it almost looked like a flower. I decided to make multiple of them, and increase the density so that they look thicker. I randomized the locations, so that slowly the screen fills up and once it’s finished, it should somewhat resemble roses (as if you’re looking down at them). This is what it looked like initially:

But after messing around with some parameters and adding a seed the end product becomes something like this:

Code Highlights

Because most of this is randomized and is one shape over and over again, the code isn’t the most technically impressive. I do like the use of Perlin noise to make radial shapes, and the randomization of the locations.

for (let j = 0; j < 2; j++){
  stroke(roseColors[currentColor]);
  push();
  translate(startX, startY);
  beginShape();
  for (let i = 0; i < 130; i++) {
    let angle = map(i, 0, 130, 0, TWO_PI);
    let radius = 150 * noise(i * 0.5, d * 0.005);
    let x = radius * cos(angle);
    let y = radius * sin(angle);
    curveVertex(x, y); 
  }
  endShape(CLOSE);

  
  beginShape();
  for (let k = 0; k < 70; k++) {
    stroke(color(142, 128, 106, 15))
    fill(color(142, 128, 106, 15))
    let seedAngle = map(k, 0, 70, 0, TWO_PI);
    let seedRadius = 15 * noise(k * 0.03, d * 0.005);
    let x = seedRadius * cos(seedAngle);
    let y = seedRadius * sin(seedAngle);
    curveVertex(x, y); 
  }
  endShape(CLOSE);
  pop();

  d += 0.5;
  
  
}

 

Here is the final product.
Improvements

I’m a very impatient person, so the amount of time it takes to fill up the screen frustrates me a little bit. In the future, I’d like to find a way to speed up the process a bit. In addition, I’d love to find the way to control the randomness a bit. Some spaces on the canvas get oversaturated with flowers too quickly while others remain blank for a long period of time. I’d love to add some control or measure that makes sure every space on the canvas is populated with one flower at least (as soon as possible).

Leave a Reply