camera.useFramingBehavior with GLTF is not right

When I use useFramingBehavior on an arcRotateCamera with a gltf file, the framing is totally incorrect and you can no longer use the zoom wheel and zoom out of the mouse, which is blocked.

It works perfectly fine with a babylon file.

On this PG I put the two different file imports to see the difference (a gltf load and a babylon load)

Hello! The difference isn’t related to the file type, but the dimensions of the mesh. When calculating the camera parameters relative to the mesh, the current camera’s minZ is used to compute the lower radius limit of the framed camera: Babylon.js/framingBehavior.ts at master · BabylonJS/Babylon.js (github.com). But in the boombox’s case, we end up with a radius that’s smaller than the minZ of the camera (which is 1 by default), leading to a radius smaller than the lower radius limit (which blocks the zoom). The solution is just to lower the camera’s minZ: glTF Loader Demo | Babylon.js Playground (babylonjs.com)

1 Like

Thank you very much @carolhmj

1 Like