DEV Community

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

Posted on • Edited on

8 2

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.

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (1)

Collapse
 
jess profile image
Jess Lee

AH, so cool!

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay