DEV Community

Cover image for Learning Generative Art; day 3 "Strings" 🎻
Masato Ohba
Masato Ohba

Posted on • Edited on

Learning Generative Art; day 3 "Strings" 🎻

(I accidentally updated this article with another content. I retrieved the original content as much as possible... 😒)

Continuation of My first step in learning Generative Art.

"Strings"

image
gif

I drew an image expressing "strings"; One string is dull, weak, and ephemeral. But once it gathers, it could be string and persistent. We can weave everything with strings.

Maybe Western people have a proverb like "three pillars of stability"? We Japanese say that "three arrows" though.

function setup() {
  createCanvas(600, 400);
  frameRate(4)
}

function draw() {
  background(255)
  for (var i = 100; i < 400; i++) {
    var r = random(200);
    stroke(color(random(r),random(i),random(i), 60));   
    line(300, r, i, 100)
    line(300, i, i, 100)

    line(i, i, i, 300)
    line(i, i, r, 300)
    line(i, r, i, 300)

    line(500, r + 200, i + 200, i)
  }
}
Enter fullscreen mode Exit fullscreen mode

TIL πŸ“

line function just draw a simple line. However, it has infinite possibilities in the generative art world.

Top comments (1)

Collapse
 
jess profile image
Jess Lee

AH, so cool!