I want to rotate a camera around the center of my model’s head (which is an fbx bone). For this I got the position of the fbx bone using .position, however, I see that this position is relative to the parent, and it’s not really the center. So how do I get the true center position (relative to the world) of a bone? Or if I can’t, is there any other ways to rotate the camera with a center of rotation at a bone?
This is my code:
loader.load("/models/soldier.fbx", function (playerMesh) {
const playerMeshRotation = playerMesh.rotation
playerMeshRotation.order = "YXZ";
playerMesh.scale.setScalar(0.01);
playerMeshRotation.y = Math.PI;
scene.add(playerMesh);
const head = playerMesh.getObjectByName("mixamorigHead");
const headPosition = head.position; // this is what i was talking about
console.log(headPosition);
});