xxxxxxxxxx
void setup() {
fullScreen();
}
void draw() {
background();
resetMatrix();
print("MOUSE POS: " + String(mouseX) + " - " + String(mouseY));
pushMatrix();
strokeWeight(5);
pushMatrix();
translate(width/2, height/2);
render(atan2((mouseY - height / 2), (mouseX - width / 2)));
popMatrix();
popMatrix();
}
void render(float _rot) {
pushMatrix();
rotate(_rot);
fill(160);
stroke(lerpColor(160, color(0), 0.1));
beginShape();
vertex(0, -5);
vertex(20, -5);
vertex(20, 5);
vertex(0, 5);
endShape(CLOSE);
popMatrix();
}