Hi everyone!
OLD TITLE OF THIS POST: How to add a camera to the head bone in a glb skeleton?
As the title says I am trying to add a camera to the head bone.
When I add the camera to the bone of an FBX skeleton it works perfectly, but when I do the same in a GLB skeleton it doesn’t work.
It seems as if the camera was not in the scene.
First look at the FBX example, you can click on the buttons to switch between the cameras, it works as expected
Now look at the GLB example
Please note that when the “Camera 2” button is clicked nothing appears on the camera.
Any suggestion?
I know there is another way to do it by copying the positions and rotations like this:
let headBone = model.children[0].children[1].skeleton.bones[5];
const position = new THREE.Vector3();
headBone.getWorldPosition(position);
const quaternion = new THREE.Quaternion();
headBone.getWorldQuaternion(quaternion);
cameraPOV.position.copy(position);
cameraPOV.quaternion.copy(quaternion);
//cameraPOV.rotation.y = cameraPOV.rotation.y + THREE.MathUtils.degToRad(180);
cameraPOV.updateMatrixWorld(true);
cameraPOVHlper.update();
But this time I want to add the camera directly to the bone.-
EDIT: I discovered that the camera attached to the bone can only see its own mesh, why does this happen?