xxxxxxxxxx
33
function setup() {
createCanvas(600, 600);
background(220);
noFill();
// position de départ
x2 = width/2;
x1 = x2 - 10;
x3 = x2 + 10;
y1 = height/2;
y2 = y1 - 20;
y3 = y1;
// intervalle
int1 = 6;
int2 = int1/2;
triangles = 10;
}
function draw() {
// triangle(x1, y1, x2, y2, x3, y3);
while(x3 <= 500 ) {
triangle(x1, y1, x2, y2, x3, y3);
y2 = y2 - int1;
x1 = x1 - int1;
x3 = x3 + int1;
y1 = y1 + int2;
y3 = y1;
// rotate(0.05);
// translate(15,-15);
}
}