When setting parameters for the mesh, ensure that the property 'matrixAutoUpdate' is true and follow the order of scale, rotation, and translation.
If a more complex series of translations and rotations is needed, set matrixAutoUpdate to false and calculate the matrix manually.
Note: when using the matrix multiply function, reverse order is crucial. For example, positioning a limb would involve:
1) Applying local rotation
2) Moving the limb with respect to its offset
3) Rotating according to body rotation
4) Moving to body offset
The actual operations should be executed in reverse order as follows:
arm_mesh.matrixAutoUpdate = false;
var mat4: THREE.Matrix4 = new THREE.Matrix4();
var arm_matrix = arm_mesh.matrix;
arm_matrix.identity(); // reset
arm_matrix.multiply(mat4.makeTranslation(body_pos.x, body_pos.y, body_pos.z));
arm_matrix.multiply(mat4.makeRotationFromQuaternion(body_rotation));
arm_matrix.multiply(mat4.makeTranslation(arm_offset.x, arm_offset.y, arm_offset.z));
arm_matrix.multiply(mat4.makeRotationFromEuler(new THREE.Euler(arm_angle, 0, 0)));
Please note that this does not consider parent/child relationships.