xxxxxxxxxx
33
function setup() {
createCanvas(600, 600);
noLoop();
}
function draw() {
background(220);
cols = 12;
rows = 22;
rectw = width/23;
push();
translate(width/4,0);
for (i=0; i<rows; i++){
for (j=0; j<cols; j++){
let rotatea = map(i, 0, rows, 0, 0.2*PI);
rotatea *= random(-1,1);
push();
translate((j*rectw + (rectw/2)), i*rectw + (rectw/2));
translate(i*random(-1,1), i*random(-1,1));
rotate(rotatea);
noFill();
rect(-rectw/2, -rectw/2, rectw, rectw);
point(0,0);
pop();
}
}
pop();
}