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 22 - Transformer Cube

dizzy-cube-1.png

I started this sketch trying to put together a bunch of cubes into one larger cube shape to learn more about working with 3D. It quickly divulged from there into…whatever this is! It almost feels like maybe the lamest transformer ever? I couldn’t get the controls right, so I just slowed the frame rate way down and added the ability to save it if a drawing you like pops up by pressing the “s” key.

Sketch:

https://editor.p5js.org/chelseamwatson/present/m92_U6Spg


Drawings:


Code:

function setup() {
  createCanvas(700, 700, WEBGL);
  strokeWeight(1);
  stroke(50);
  frameRate(0.5);
}

function draw() {

  background(50);

  let s1 = random(50, 150);
  let s2 = random(50, 150);
  let s3 = random(50, 150);

  rotateX(millis(2000) / 2000);
  rotateY(millis(2000) / 2000);

  fill(s1, s2, s3);
  box(s1, s2, s3);

  fill(s2, s1, s1);
  translate(80, 0);
  box(s2, s1, s1);

  fill(s3, s1, s2);
  translate(0, 0, 80);
  box(s3, s1, s2);

  fill(s3, s2, s2);
  translate(-80, 0);
  box(s3, s2, s2);

  fill(s1, s3, s3);
  translate(0, 80);
  box(s1, s3, s3);

  fill(s2, s3, s2);
  translate(80, 0);
  box(s2, s3, s2);

  fill(s2, s2, s1);
  translate(0, 0, -80);
  box(s2, s2, s1);

  fill(s3, s1, s3);
  translate(-80, 0);
  box(s3, s1, s3);

}

function keyReleased() {
  if (key == 's' || key == 'S') saveCanvas();
}

Chelsea Watson