# camera.useFramingBehavior with GLTF is not right

**URL:** <https://forum.babylonjs.com/t/camera-useframingbehavior-with-gltf-is-not-right/37004>\
**Category:** Bugs\
**Created:** [December 30, 2022, 9:49pm UTC](https://forum.babylonjs.com/t/camera-useframingbehavior-with-gltf-is-not-right/37004 "2022-12-30T21:49:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dad72](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dad72/32/13_2.png) [@Dad72](https://forum.babylonjs.com/u/Dad72)\
**Post date:** [December 30, 2022, 9:49pm UTC](https://forum.babylonjs.com/t/camera-useframingbehavior-with-gltf-is-not-right/37004/1 "2022-12-30T21:49:30Z")

</div>

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)

> **[Babylon.js Playground](https://playground.babylonjs.com/#WGZLGJ%237293)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [January 2, 2023, 2:18pm UTC](https://forum.babylonjs.com/t/camera-useframingbehavior-with-gltf-is-not-right/37004/2 "2023-01-02T14:18:19Z")

</div>

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)](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Behaviors/Cameras/framingBehavior.ts#L349). 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)](https://playground.babylonjs.com/#WGZLGJ#7298)

---

<div class="post-metadata">

**Author:** ![Dad72](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dad72/32/13_2.png) [@Dad72](https://forum.babylonjs.com/u/Dad72)\
**Post date:** [January 2, 2023, 4:13pm UTC](https://forum.babylonjs.com/t/camera-useframingbehavior-with-gltf-is-not-right/37004/3 "2023-01-02T16:13:06Z")

</div>

Thank you very much @carolhmj
