xxxxxxxxxx
29
function setup() {
createCanvas(600, 600);
}
function draw() {
clear();
let padding = 100;
let v1 = createVector(0 + padding,0 + padding);
let v2 = createVector(width-padding,0 + padding);
let v3 = createVector(width-padding,height-padding)
let v4 = createVector(0 + padding, height-padding);
stroke('black');
noFill();
// fill(mouseY);
triangle(v1.x, v1.y, v2.x, v2.y, mouseX, mouseY);
// fill(width-mouseX);
triangle(v2.x, v2.y, v3.x, v3.y, mouseX, mouseY);
// fill(height-mouseY);
triangle(v3.x, v3.y, v4.x, v4.y, mouseX, mouseY);
// fill(mouseX);
triangle(v4.x, v4.y, v1.x, v1.y, mouseX, mouseY);
}