xxxxxxxxxx
54
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();
}