xxxxxxxxxx
31
/*
transformation example
3.11.2024
*/
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
translate(200, 200);
circle(0, 0, 100);
square(0, 0, 100);
var r = map(mouseX, 0, width, 0, PI * 2);
rotate(r);
var s = map(mouseY, 0, height, 0, 2, true);
scale(s);
square(0, 0, 100);
}