Not drawing at desired position in “Processing”
问题 I am trying to draw at one place by dragging a mouse (for example, a circle in left upper quadrant) and have the figure appear at 4 places around center of canvas (including one right under the mouse cursor). I have tried following code: int x=0; int y=0; void setup(){ size(400, 400); background(255); translate(width/2, height/2); } void draw() { } void mouseDragged(){ translate(width/2, height/2); for(int i=0; i<4; i++){ rotate(PI/2); x= mouseX ; y=mouseY; line(x, y, mouseX, mouseY); } }