openbim-components | OrthoPerspectiveCamera is slow/stuck when I zoom in the model

55 Views Asked by At

I have an issue using the OrthoPerspectiveCamera in my App (from openbim-components package). When I am zooming into my model, it automatically switches into FirstPerson mode. And then, it becomes really slow to zoom in/out into the scene. I am searching for a way to disable this automatic mode change with OrthoPerspectiveCamera. Is there an option witch the class or something like that?

I tried to zoom into a model, and the camera automatically switches to first person and becomes very, very slow. It becomes difficult to move around afterwards. I would like this camera to stay in orbit mode.

1

There are 1 best solutions below

0
MiguelG On

It turns that open bim components is making use of camera controls package, https://github.com/yomotsu/camera-controls, and the issue is with the default dolly setup.

Basically you need set the infinityDolly prop value equal true and configure the min and max distance to push the target:

const cameraComponent =
  new OBC.OrthoPerspectiveCamera(viewer);
cameraComponent.controls.infinityDolly = true;
    cameraComponent.controls.minDistance = 3;
    cameraComponent.controls.maxDistance =5;

Checkout the sample: https://yomotsu.github.io/camera-controls/examples/infinity-dolly.html

Hope it help!