Week2–Generative art

My concept

After watching the video, I wanted to experiment with randomness in my artwork and discover what visual possibilities it could create.
I realised that the effect of chance would not be very clear within just one static image. For this reason, I used ‘mousePressed’ as an interactive feature: every click reruns all the random values and generates a brand‑new composition. This allows the viewer to see the wide variety of outcomes produced by one single system.
I chose two simple forms: bezier curves and circles of varying sizes. I defined their general shape, boundaries and direction, while letting random() decide their exact position, size and colour. Rather than placing each curve and circle by hand, I let the code produce unexpected arrangements. My aim is to observe the balances and relationships between curves and circles.

How this was made?

for (let i = 0; i < 10; i++) {
    let circleX = random(30, width - 30);
    let circleY = random(30, height - 30);
    let diameter = random(15, 90);
    noStroke();
    fill(random(255), random(255), random(255));
    circle(circleX, circleY, diameter);
  }

For the random circles I used a for‑loop. I wanted ten circles in total. Their coordinates are random, and so are their diameters. However, I set rough limits for these values: a range for their size and another for their position. Their colours are also random.

for (let m = 0; m < 8; m++) {
    drawCurve();
  }
function drawCurve() {
  let x1 = random(-20, width + 20);
  let y1 = random(-20, 0);
  for(let i = 0; i < 8; i++){
    let cx1 = x1 + random(-75,75);
    let cy1 = y1 + random(-65,65);
    let cx2 = x1 + random(-75,75);
    let cy2 = y1 + random(35,95);
    let x2 = x1 + random(-55,55);
    let y2 = y1 + random(65,115);

    bezier(x1, y1, cx1, cy1, cx2, cy2, x2, y2);
    x1 = x2;
    y1 = y2;
  }
}

For the lines, I was not sure at first which shape to use. After checking the p5.js reference page, I found that the bezier curve worked best for my idea. I then briefly learned how its coordinates function and how to control them, and started to build my curves.
I discovered that without startX = endX and startY = endY, all the segments would cluster near the top of the canvas and would not connect together. This created a problem. Once I noticed this issue, I adjusted my code and asked AI to help me understand why it was happening.

Reflection

I have realised that creating artwork with random() saves a lot of time. Unlike my self‑portrait project, where I had to carefully refine every single detail, randomness can unexpectedly produce really appealing patterns. I feel I could use randomness more often in my future artworks. I really enjoyed this creative process and kept experimenting throughout. Right now I have only used curves and circles, which are still quite basic and simple. I hope in the future I can use randomness to generate more complex forms.

Leave a Reply