Toggling framingBehavior

I am using framingBehavior to automatically show all the objects in the mesh when they are loaded. However, I would like to have the framing behavior and bounds disabled after the objects are loaded for the first time.

I have tried:

var framingBehavior = new BABYLON.FramingBehavior();

framingBehavior.zoomOnMesh(myMesh, false, () => {

and = true; = 1;; = false;

In both cases, when zooming manually, the framing bounds are still enforced and zooming is limited to keep the whole mesh visible. Is there a way to completely remove them, as if framingBehavior was never set to true to start with?

Thank you!

you can change the camera upperRadiusLimit and lowerRadiusLimit in you zoomOnMesh callback and place them back to what you want


Thanks @sebavan. That worked.

P.S. Your response time is amazing! :slight_smile: :+1:

1 Like