trouble reading mouseX and mouseY
in
Programming Questions
•
2 years ago
I am trying to change the angle of a line by sensing movement of the mouse, I use the following code but get no results, I used println() to monitor the values of X1 and X2 and the difference is always 0. I don't know much about processing or programming in general any help would appreciated! Thanks for your time and help!
void draw(){
mouseX1 = mouseX;
mouseY1 = mouseY;
delay(1000);
mouseX1 = mouseX;
mouseX2 = mouseY;
if (mouseX2 - mouseX1 > 0) {
phi = phi + .174;
}
boomX = boom*cos(phi);
boomY = boom*sin(phi);
line(0,0,boomx,boomy);
}
1