Generative Art

Use the concept of time to create a work. Time can be an abstract linear time. If you change the time, the work will have different growth directions/changes, that is, Generative Art.
"Generative art" often refers to algorithmic art (algorithmically determined computer-generated artwork), but artists can also make it using systems of chemistry, biology, mechanics and robotics, smart materials, manual randomization, mathematics, data mapping, symmetry, tiling, and more.



Repeating patterns, using if statements, and using loops and function definitions.

Code:

let x = 0;
let y = 0;

function setup() {
  createCanvas(400, 400);
  background(200, 200, 100);
  stroke(255);
  strokeWeight(2);
}

function draw() {

// 随机概率 向左向右
  if (random(1) > 0.5) {
    line(x, y, x + 20, y + 20);
  } else {
    line(x, y + 20, x + 20, y);
  }

  x += 20;
  
  if (x > width) {
    x = 0;
    y += 20;
  }

  if (y > height) {
    background(200, 200, 100);
    x = 0;
    y = 0;
  }
}

Comments

Popular Posts