xxxxxxxxxx
43
/*
Based on translation of Georg Nee's Shotter
from Code as a Creative Medium:
https://github.com/CodeAsCreativeMedium/exercises/blob/main/02_iteration/15_recoding_schotter/schotter_js/schotter_js.js
Original:
http://dada.compart-bremen.de/item/artwork/1
*/
let angle = 0;
let size;
function setup() {
createCanvas(windowWidth, windowHeight);
noFill();
stroke(255);
strokeWeight(2);
smooth();
noLoop();
}
function draw() {
background(0);
size = min(width / 10, height / 10);
for (let y = size; y < height - size; y += size) {
for (let x = size; x < width - size; x += size) {
push();
translate(x + size / 2, y + size / 2);
rotateAmount = random(-angle, angle);
rotate(rotateAmount);
square(-size / 2, -size / 2, size);
pop();
}
angle += 0.05;
}
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
angle = 0;
}