xxxxxxxxxx
31
// Coding Train / Daniel Shiffman
// Transformations in p5.js
// Part 2: Scale
// https://thecodingtrain.com/tracks/transformations-in-p5/transformations/scale
// https://youtu.be/o9sgjuh-CBM
let angle = 0;
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
// rectMode(CENTER);
}
function draw() {
background(0);
push();
translate(200, 200);
// scale(4);
// scale(mouseX / 100, mouseY / 100);
// scale(1, 1);
scale(1, -1);
rotate(angle);
stroke(255);
fill(100);
rect(0, 0, 100, 50);
pop();
angle = angle + 2;
}