Best way to center camera on a given ObjectID?

  • Objective: I am currently trying to impliment a feature simplar to presing f function in modering softwares focusing you on the selected object or the whole scene.

  • Issue: Current approach I’m using simply focuses the camera gaze towards the object and puts the whole scene in view even though I’m trying to set the bounds to object bounds.

//note boundingBox here is a given objectIds bounding box
 cameraController.setCameraView(boundingBox, true)

Hi @Leul_Tesfaye

There might be an issue with the box you pass in. I’ve made a live example that shows the feature working correctly. I suggest you use boxFromObjects to compute the union box for your objects.

Maybe the box you compute for you objects spans across the entire scene?

Cheers