Hi, I am in a beginner programming class, my final exam is Monday, when going over the review, I am having trouble with this one problem.. I need to make a barbell(line with an ellipse at each end) that rotates around its center, follow the mouse around the window. I have put together code for the barbell to rotate in the center of the screen. Any attempt to get the barbell to follow the mouse has been a disaster to the code... Any help or tips would be appreciated thank you...
Hi sorry to ask such an elementary question but I am new to processing and really need help. Suppose I run this code this in Processing:
void setup ()
{
size (400, 400);
background (125);
stroke (1);
}
void draw ()
{
// pmouseX, pmouseY: previous pointer coordinates
// mouseX, mouseY: current pointer coordinates
line (pmouseX, pmouseY, mouseX, mouseY);
}
It will use the variables to draw a line that follows the movement of the pointer around the program window. I need to modify the code so that Processing clears the screen whenever I click the mouse button. Any advice would be greatly appreciated, Thank you.
[Moderator's note: I renamed the title from "Question need help asap" which isn't informative at all on the nature of the question... Also marked the thread as answered, even if very few people do it actually...]