BlackMojito Posted October 26, 2017 Share Posted October 26, 2017 Hi, Is there an easy way to compete the bounding box or sphere of a scene? I would like to adapt my ArcRotateCamera radius to it. If there is not such a method, I will need to iterate over all the meshes and then combine them...which is really boring. Thanks Wingnut 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted October 26, 2017 Share Posted October 26, 2017 scene.getWorldExtends() will give you a bounding box (min and max vectors) that you could use. The ARcRotate's FramingBehavior (camera.useFramingBehavior = true) will actually set the limits to your arc rotate using the scene, so you could use this as well. You might want to disable features you don't want (like zoom on a model). Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted October 26, 2017 Share Posted October 26, 2017 Hi guys! arcCam.useFramingBehavior? Cooooool! I like that one. Thx for ref, RainMan... err.. Raanan. Did you invent that feature, R? Nice. We have had quite a few requests for "keep all mesh in-view", eh? *nod* xuchen: (loose quote) Summing all mesh boundingBoxes... to compute total scene.meshes.boundingBox area... yep... seriously boring. FUNNY, and true. Sort of like requiring 24 hours of foreplay before... umm... nah, let's not go there. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 26, 2017 Share Posted October 26, 2017 Documentation for behaviors: http://doc.babylonjs.com/features/behaviour And more specifically the framingBehavior:http://doc.babylonjs.com/how_to/camera_behaviors#framing-behavior Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.