Gltf Import: Camera usage

Hi! I Loaded a glb File from Blender with an Camera. So I wanted to use this camera in the Three.js viewer and add some OrbitControls.
The Camera is not moving. But when I use my own Perspective Cam everything is ok. But I cant get this cam to the Position if the one in the glb.

When I use[0];
in the loader.load then I see the correct Object but cant move.

When I use = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 10000 );

And In the Loader.load[0].position);
I get a moving Camera which is completly wrong. Position of the gltf.cameras[0] is (0,0,0).

I found the Bug. And it was in Blender. Blender uses an Object and parents the camera to it. So the Camera will always have 0,0,0 because it is on the same place as the Object. Found the Solution when I was browsing the scene in the Javascript browser of chrome. The Camera had a parent and this had all needed Information.

Now with[0].parent.position);[0].parent.quaternion);[0].parent.scale);
Everything works. copy of the Object does not work, because the parent is no Camera

Hope someone else will need this Info in the Future!


If the camera has rotation, still need to get the product of two quaternion
const newQuaternion = camera.parent.quaternion.multiply(camera.quaternion)
and then send to camera quaternion;