How to get the largest mesh size in the scene

I want to switch the camera view according to the largest grid in the scene

Could you provide a repro in Playground so we would be able to help you better?

So, with the ‘largest grid’ you mean the ‘largest mesh’, am I right?
Also, as far as I understand you don’t need to take the ground into account?

You can do something like this:

    const largest = scene.getMeshesById('').sort((a,b) => 
       b.getBoundingInfo().boundingBox.extendSizeWorld.length() -

extendSizeWorld.length is volume of bounding box. Not sure what you mean by largest.

Hope that helps!


1 Like


thanks a lot i’ll try it