xxxxxxxxxx
21
let zoom = 1;
function setup() {
createCanvas(400, 400);
print("use: mouse x,y for center\nmouseWheel zoom");
}
function draw() {
translate(mouseX, mouseY);
scale(zoom);
background(200, 200, 0);
noFill();
stroke(0, 0, 200);
strokeWeight(5);
for (let i = 0; i < 10; i++) circle(0, 0, (i + 1) * 100);
}
function mouseWheel(event) {
zoom += event.delta * 0.1; // rollover at 0 ( mirroring )
print("zoom " + nf(zoom,1,1));
}