xxxxxxxxxx
38
/*
example of assignment 1
abstract shape composition
by prof roberts
jan 27, 2025
*/
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
noFill();
// circle(50, 50, 50);
// circle(50 + 20 * 1, 20 + 10 * 1, 20 + 50 * 1);
// circle(50 + 20 * 2, 20 + 10 * 2, 20 + 50 * 2);
// circle(50 + 20 * 4, 20 + 10 * 4, 20 + 50 * 3);
// circle(50 + 20 * 8, 20 + 10 * 8, 20 + 50 * 4);
// circle(50 + 20 * 16, 20 + 10 * 16, 20 + 50 * 5);
triangle(0, 100 * 1, 400, 0, 200, 400);
triangle(0, 100 * 2, 400 / 2, 0, 200 / 2, 400 / 2);
triangle(0, 100 * 3, 400 / 4, 0, 200 / 4, 400 / 4);
triangle(0, 100 * 4, 400 / 8, 0, 200 / 8, 400 / 8);
triangle(0, 100 * 5, 400 / 16, 0, 200 / 16, 400 / 16);
triangle(0, 100 * 6, 400 / 32, 0, 200 / 32, 400 / 32);
}
function mousePressed() {
save("shapes.png");
}