Hi!
I have cropped your arm image:
/**
* Arm.
*
* The angle is controlled with the mouseX and
* mouseY position. The transformations are applied inside
* the pushMatrix() to popMatrix() code: the red dot is outside
* so it's not affected.
*/
PImage img;
//Position of the arm image
float x = 150;
float y = 100;
//Position of the center of rotation in the arm image
float centerRelativeX=30;
float centerRelativeY=5;
float angle = 0.0;
void setup() {
size(500, 500);
smooth();
img=loadImage("arm.png");
}
void draw() {
background(255);
angle = (mouseX/float(width) - 0.5) * -PI;
pushMatrix();
translate(x+centerRelativeX,y+centerRelativeY);
rotate(angle);
translate(-x-centerRelativeX,-y-centerRelativeY);
image(img,x,y);
popMatrix();
fill(255,0,0);
ellipse(x+centerRelativeX,y+centerRelativeY,5,5);
}