Why does viewer.navigation.setView in Autodesk Forge Viewer behave relative instead of absolute? (position + target / quaternion both fail)

I’m using Autodesk Forge Viewer (v7) and trying to move the camera to predefined world-space positions.

Example code:

const cameraPositions = [
  { 
    position: new THREE.Vector3(32.67, -85.05, 26.20),
    target: new THREE.Vector3(0, 0, 0)
  },
  { 
    position: new THREE.Vector3(3.67, -15.05, -1),
    target: new THREE.Vector3(5, 0, -1)
  }
];

function moveCameraToArrayPosition(index) {
  const targetData = cameraPositions[index];
  viewer.navigation.setView(targetData.position, targetData.target);
  viewer.impl.invalidate(true, true, true);
}

Issue:
When I press my navigation buttons, the camera moves differently depending on my current position/orientation. It feels relative to the current camera, instead of jumping to an absolute world coordinate and lookAt.

What I tried:

viewer.navigation.setView(position, target) (above)

Setting camera with position + quaternion / rotation manually (viewer.navigation.setCamera)

Both approaches still behave inconsistently – the final camera depends on where I was before.

Questions:

Am I misunderstanding how Forge Viewer treats camera transforms?

Is there a correct way to move the camera to an absolute position + orientation, regardless of previous state?

Do I need to reset the navigation state (orbit, perspective, etc.) before applying transforms?

The docs for Navigation.setView
don’t explain why this happens.

Any help would be appreciated!

I tried moving the camera using:

viewer.navigation.setView(position, target)

viewer.navigation.setCamera(position, target, up)

Also setting position + quaternion / rotation directly

I expected the camera to always jump to the same absolute world position and orientation, independent of where the camera was before.

Instead, the movement behaves differently depending on my current location and orientation — the result feels relative, not absolute.

Read more here: Source link