100x100 Computational Design Challenge

Throughout 2020 I created 100 computational designs in 100 days as a way to learn creative coding and explore generative art

Day 86 - Corners

corners-3.png

Taking it back to basics this week, exploring and refining some simple ideas. My mind is thinking in embroidery and string and textiles again, and am looking forward to playing with more tactile materials once this challenge is over.

Sketch:

https://editor.p5js.org/chelseamwatson/present/5MX9Hl4wC


Pseudocode:

  • Draw a diagonal line angled up

  • When the line gets to a certain point, reverse the line to angle down

  • When the line gets to the end of the canvas, restart again from the left and move the starting point down slightly

  • Make the line a new random colour each time it restarts


Drawings:


Code:

function setup() {
  createCanvas(800, 800);
  background(245, 243, 240);
  x = random(100, 300);
  hR = random(300, 500);
  xR = random(500, 700);
  yS = 200;
  y = yS;
  yR = random(0.1, 0.4);
  rR = random(0, 255);
  rG = random(0, 255);
  rB = random(0, 255);
}

function draw() {

  if (x < 200 || x > 600 || y < 200 || y > 600) {
    stroke(245, 243, 240);
  } else {
    stroke(rR, rG, rB);
  }

  ellipse(x, y, 1);
  x = x + 1;

  if (x < hR) {
    y = y - yR;
  }

  if (x > hR) {
    y = y + yR;
  }

  if (x > xR) {
    x = random(100, 300);
    yS = yS + 5;
    y = yS;
    xR = random(500, 700);
    rR = random(0, 255);
    rG = random(0, 255);
    rB = random(0, 255);
  }
}

Chelsea Watson