I have sculpted a humanoid figure and now I am attempting to animate the figure waving with its left hand when the waveButton is clicked. I established a hierarchy where the body element is the parent, with leftArm, rightArm, leftLeg, rightLeg, and head as its children.
//creating body
var body = new THREE.Mesh( geometry, material );
body.position.set(0,0,0 );
//creating leftArm
var geometry = new THREE.BoxGeometry(sizes.armW,sizes.armH,sizes.armD);
var leftArm = new THREE.Mesh(geometry, material);
leftArm.position.set(sizes.bodyW/2 + sizes.armW/2,sizes.bodyH/100,0);
//In this function, I am attempting to rotate the arm for waving, but it rotates around its middle point like a clock hand.
function waveHand()
{
leftArm.rotation.z += direction * 0.01;
}
How can I modify this function so that the hand remains connected to the body and waves from that position instead of becoming detached and rotating around its center?