Initialize scene with camera view from imported glb (with OrbitControls on)

Hey there!

I need some help with the camera handling in connection with the OrbitControls.

In my code (and please don’t judge. It’s the first time in 3 years I coded) I imported the glb-File with the GLTFLoader.

When I console.log(glbFile) I can see the PerspectiveCamera-Object in that glb.
Then I want to add the camera to the scene and add some OrbitControls (also with that camera from the glb file).
But how do I set the initial view of the scene to the view from the camera with OrbitControls on?
I know that there is the method, but I only have the camera position.
When I set the to the camera.position it’s not quite the view I’m looking for.
In theory the point must be set the “middle point of the viewing object”.

Or there’s another solution?

Please help!


Here is my glb loader function:

loader.load(glbFile, function (gltf) {
  /* TODO GLB-Datei*/

  const model = gltf.scene;

  const cameraName = $("#Container").data("modellid").replace(/ /g, "_");
  const cameraFromGLB = gltf.cameras.find(obj => == cameraName);
  if (cameraFromGLB == undefined) {
    camera.position.set(1, 1, 1);
    controls = new OrbitControls(camera, renderer.domElement);
    error.innerHTML += `<p class="error">Camera with name ${cameraName} not found. Standard camera will be used.</p>`;
  } else {
    camera = cameraFromGLB;
    controls = new OrbitControls(camera, renderer.domElement); // this is the HOT PART, camera.position.y, -camera.position.z);

  scene.add(new THREE.GridHelper(20, 10));

  controls.enablePan = true;
  controls.enableDamping = false;

  mixer = new THREE.AnimationMixer(model);
  mixer.addEventListener('finished', function(e) {
    stopActionButton.className = 'btn-viewer hidden';
    element.className = 'btn-viewer active';
    if (activeAction) {
      activeAction.timeScale = 0;
  actions = {}

  const animationList = gltf.animations;
  /* TODO Suche eine Animation und erzeuge Button dafür*/
  const animationName = $("#Container").data("modellid");

  let clip = animationList.find(obj => == animationName);
  let action = null;
  if (clip !== undefined) {
    action = mixer.clipAction(clip);
  } else {
    clip = animationList[0];
    action = mixer.clipAction(clip);
    error.innerHTML += `<p class="error">Animation with name ${animationName} could not be found. First animation will be played.</p>`;

  action.clampWhenFinished = true;
  action.loop = THREE.LoopOnce;
  actions[] = action

  element.type = 'button';
  // element.value =; TO DO
  element.value = 'Play'; =;
  element.className = 'btn-viewer active';
  element.onclick = function () {
    fadeToAction(, 0.5)

  if (clip && action) {
    stopActionButton.type = 'button';
    // element.value =; TO DO
    stopActionButton.value = 'Stop'; = 'Stop';
    stopActionButton.className = 'btn-viewer hidden';
    stopActionButton.onclick = function () {