xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
}
function draw() {
background(0);
let c = 15;
let w = width / c;
for (let i = 0; i < c; i++) {
for (let j = 0; j < c; j++) {
let x = i * w + w / 2;
let y = j * w + w / 2;
let s = w * noise(frameCount * 0.01, i, j);
if (random(3) < 0.5) {
wo(x, y, s);
// rect(x, y, s, s, 10, 30);
frameRate(30);
fill(274, 70, 68);
stroke(175, 86, 77);
strokeWeight(5);
drawingContext.shadowOffsetY = 10;
drawingContext.shadowBlur = 30;
drawingContext.shadowColor = color(12, 73, 100);
} else {
if (random(1) < 0.5) {
rect(x, y, s, s, 10, 30);
frameRate(20);
fill(274, 70, 68);
stroke(175, 86, 77);
strokeWeight(5);
drawingContext.shadowOffsetY = 10;
drawingContext.shadowBlur = 30;
drawingContext.shadowColor = color(12, 73, 100);
}
}
}
}
// wo();
}
function wo() {
noFill();
stroke(46, 196, 182);
rotateX(frameCount * 0.01);
rotateY(frameCount * 0.01);
box(45, 45, 45);
}