1 min read

from beneath

from beneath

a coded poem

//poem is in the comments (they describe the code as well)

let air; //there is this substance
let radiance = 3; //that drifts towards a light
let nBubbles = 1000; //encapsulated
function setup() {
  c = max(800, min(windowWidth, windowHeight)) * 0.9; //in which you witness
  createCanvas(c, c); //through your senses
  background(0); //from nothing
  ctr = createVector(
    random(-width / 5, width / 5),
    random(-height / 5, -height / 3)
  ); //to a single point
  hues = {
    r1: random(0, 50),
    g1: random(100, 150),
    b1: random(140, 200)
  }; //it is from the depths
  noStroke(); //without definition
  air = [];
  for (let i = 0; i < nBubbles; i++) {
    air.push(new Air());
  } //you can see what catches the light
}

function draw() {
  translate(width / 2, height / 2); //your position
  t = frameCount; //in time
  push(); //is relative
  rotate(-t / 2000); //to the rotation of everything
  for (let i = c * 2.5; i > 0; i -= 4) {
    //that is focused - here
    fill(
      hues.r1 + 180 - i / radiance,
      hues.g1 + 180 - i / radiance,
      hues.b1 + 180 - i / radiance,
      80
    );
    circle(ctr.x, ctr.y, i);
  }
  for (let i = 0; i < air.length; i++) {
    air[i].move(); //change
    air[i].display(); //is what makes you aware of life
  }
  pop();
  //here you are - now you are -  from beneath
}

class Air {...}

See the Pen from beneath by Sophia (fractal kitty) (she/her) (@fractalkitty) on CodePen.

Want to become a better programmer? Join the Recurse Center!

Sophia

Mathematics educator and creative coder exploring the beauty of mathematical concepts through interactive visualizations and playful learning.

Mathematics

Education

Creative Coding