xxxxxxxxxx
35
function setup() {
createCanvas(680, 1000);
}
function draw() {
background("linen");
noFill();
rectMode(CENTER);
frameRate(0);
let offset = 0;
let rotations = 0;
for (let j = 0; j < 22; j++) {
offset += 1;
rotations += 1;
for (let i = 0; i < 12; i++) {
let ox = 134;
let oy = 113;
let x = ox + i * 37;
let y = oy + j * 37;
drawRect(x + random(-offset, offset), y + random(-offset, offset));
}
}
function drawRect(x, y) {
push();
translate(x, y);
rotate(radians(random(-rotations, rotations)));
rect(0, 0, 37, 37);
pop();
}
}