xxxxxxxxxx
64
let a = 0;
function setup() {
createCanvas(600, 600);
colorMode(HSB);
background(0,0,25);
angleMode(DEGREES);
}
function draw() {
let mouseXPosition360 = map(mouseX,0,width,0,360);
let mouseYPosition360 = map(mouseY,0,height,0,360);
strokeWeight(5);
stroke(mouseXPosition360,35,100);
fill(100,100,mouseXPosition360);
customShape(width/2,height/2,0,0);
fill (mouseYPosition360,mouseXPosition360,100);
customShapeTwo(width/2,height/2,100,100);
a = mouseXPosition360
}
function customShape(x,y,w,h){
push();
translate(x,y);
rotate(a);
beginShape();
vertex(200,200);
vertex(w,200);
vertex(100,h);
endShape(CLOSE);
pop();
}
function customShapeTwo(x,y,w,h){
push();
translate(x,y);
rotate(a);
beginShape();
vertex(0,0);
vertex(w,0);
vertex(w,h);
vertex(0,h);
endShape(CLOSE);
pop();
}