xxxxxxxxxx
67
function T(w, h){
triangle(w / 2, 0, 0, h, w, h);
}
function R(w, h){
rectMode(CORNERS);
rotate(30);
rect(-w / 3 - 40, w / 3, w / 4 - 10, h);
}
function C(){
}
function setup() {
createCanvas(400, 400);
}
function draw() {
noFill();
frameRate(1);
background(255);
strokeWeight(3);
for(var i = 0; i < 3; i ++){
for(var j = 0; j < 3; j ++){
var x = width / 3 * i + 20;
var y = height / 3 * j + 20;
push();
translate(x, y);
if(i == 0 && j == 0){
T(width / 4, height / 4);
}
else if(i == 1 && j == 0){
R(width / 4, height / 5);
}
else if(i == 2 && j == 0){
circle(width/ 4 - width / 8, height / 6, width / 5);
}
else if(i == 0 && j == 1){
line(0, 0, width / 4, height / 4);
}
else if(i == 1 && j == 1){
line(85, 20, 10, 10);
line(90, 90, 15, 80);
stroke(0, 0, 0);
bezier(85, 20, 10, 10, 90, 90, 15, 80);
}
else if(i == 2 && j == 1){
ellipse(width/ 4 - width / 8, height / 6, width / 5, 39);
}else if(i == 0 && j == 2){
arc(50, 55, 50, 50, 0, HALF_PI * 3);
}else if(i == 1 && j == 2){
quad(38, 31, 86, 20, 69, 63, 30, 76);
}
else if(i == 2 && j == 2){
line(30, 20, 85, 75);
line(85, 75, 85, 30);
}
pop();
}
}
}