devAxeon Posted September 19, 2017 Share Posted September 19, 2017 Hi, I'm trying to show the bounding box of a subMesh only. So I tried: scene.getBoundingBoxRenderer().renderList.push(subMesh.getBoundingInfo().boundingBox); scene.getBoundingBoxRenderer().render(); and the same thing with creating a new BoundingBoxRenderer but nothing append... Using mesh.showBoundingBox = true; and mesh.showSubMeshesBoundingBox = true; always show ALL the bounding boxes... So, is it possible to do what I'm expecting or am I just doing something wrong ? Quote Link to comment Share on other sites More sharing options...
Arte Posted September 19, 2017 Share Posted September 19, 2017 Hi @devAxeon and welcome to forum, Did you tried: subMesh.showBoundingBox = true; ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 19, 2017 Share Posted September 19, 2017 Hello the list of boundingBoxRenderers is cleared on every render: https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.scene.ts#L2694 You can try this: mesh.onBeforeRenderObservable.add(function() { scene.getBoundingBoxRenderer().renderList.push(subMexh.getBoundingInfo().boundingBox); }); Arte 1 Quote Link to comment Share on other sites More sharing options...
devAxeon Posted September 19, 2017 Author Share Posted September 19, 2017 Hi, Yes @Arte, but subMeshes are not abstract meshes and have not this property... Thank you @Deltakosh, this work perfectly !! 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.