xxxxxxxxxx
39
class Tri {
constructor(x1, y1, x2, y2, x3, y3, c, index) {
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
this.x3 = x3;
this.y3 = y3;
this.c = c;
this.index = index;
}
show(){
strokeWeight(noise(coff1) * 4);
noiseSeed(floor(this.index));
coff1 = coff1 + 0.0001;
coff2 = coff2 + 0.00009;
coff3 = coff3 + 0.00011;
fill(noise(coff1) * 255, noise(coff2) * 255, noise(coff3) * 255, noise(coff1, coff2, coff3) * 100 + 90);
triangle(this.x1, this.y1, this.x2, this.y2, this.x3, this.y3);
// circle(this.x1, this.y1, this.y3);
}
move(){
noiseSeed(floor(this.index));
xoff1 = xoff1 + 0.00005;
xoff2 = xoff2 + 0.0001;
xoff3 = xoff3 + 0.00008;
yoff1 = yoff1 + 0.00009;
yoff2 = yoff2 + 0.00006;
yoff3 = yoff3 + 0.00007;
this.y1 = noise(xoff1, yoff1) * height;
this.y2 = noise(xoff2, yoff2) * height;
this.y3 = noise(xoff3, yoff3) * height;
this.x1 = noise(yoff1, xoff1) * width;
this.x2 = noise(yoff2, xoff2) * width;
this.x3 = noise(yoff3, xoff3) * width;
}
}