adam Posted February 14, 2016 Share Posted February 14, 2016 I'm having issues with parts of my model not showing when it extends beyond the bounding box at the edge of the screen. I tried using the extendSize property, but it doesn't seem to have any effect. Has anyone had any success with updating the size of the bounding box? Quote Link to comment Share on other sites More sharing options...
jerome Posted February 14, 2016 Share Posted February 14, 2016 yep : https://github.com/BabylonJS/Babylon.js/blob/master/src/Culling/babylon.boundingInfo.ts#L45 http://doc.babylonjs.com/classes/2.3/AbstractMesh#getboundinginfo-rarr-boundinginfo-classes-2-3-boundinginfo- So something, like : mesh.getBoundingInfo().update(mesh._worldMatrix); should do the job (not tested : check the syntax) Else, simpler : http://doc.babylonjs.com/classes/2.3/Mesh#refreshboundinginfo-rarr-void mesh.refreshBoundingInfo(); will force the BoundingInfo re-computation Quote Link to comment Share on other sites More sharing options...
adam Posted February 14, 2016 Author Share Posted February 14, 2016 I tried calling refreshBoundingBox refreshBoundingInfo every frame, but doesn't appear to be doing anything (it doesn't change on the debug layer). I was hoping I could just set the extendSize variable when the model loads. All I need is to scale the bounding box by 1.5 or 2 on the x axis. Quote Link to comment Share on other sites More sharing options...
jerome Posted February 14, 2016 Share Posted February 14, 2016 actually, this is refreshBoundingInfo() Do you have a PG ? Quote Link to comment Share on other sites More sharing options...
adam Posted February 14, 2016 Author Share Posted February 14, 2016 For now, I'm just going to add some extra invisible vertices to the model in order to force a larger bounding box. If anyone knows another simple and efficient way to force a larger bounding box I would gladly do that instead of my invisible vertices hack. Thanks Quote Link to comment Share on other sites More sharing options...
adam Posted February 14, 2016 Author Share Posted February 14, 2016 Unfortunately, I can't release this model in a PG. Quote Link to comment Share on other sites More sharing options...
jerome Posted February 14, 2016 Share Posted February 14, 2016 var vis = 100; // visibility scaling mesh._boundingInfo = new BABYLON.BoundingInfo(new Vector3(-vis, -vis, -vis), new Vector3(vis, vis, vis)); adam 1 Quote Link to comment Share on other sites More sharing options...
adam Posted February 14, 2016 Author Share Posted February 14, 2016 That is what I was looking for. Thanks! Quote Link to comment Share on other sites More sharing options...
adam Posted February 15, 2016 Author Share Posted February 15, 2016 I'm going to have to make another model that I can use in a PG because I'm still having issues with submeshes (eyes) randomly not displaying at the edge of the screen even after increasing the size of the bounding box and sphere. Quote Link to comment Share on other sites More sharing options...
adam Posted February 15, 2016 Author Share Posted February 15, 2016 Here is the PG: http://www.babylonjs-playground.com/#1K8ZRL#3 Zoom out and move the camera around to see the issue with eyes. Quote Link to comment Share on other sites More sharing options...
jerome Posted February 15, 2016 Share Posted February 15, 2016 http://www.babylonjs-playground.com/#1JFDFW#12 lines from 219 to 223 Quote Link to comment Share on other sites More sharing options...
adam Posted February 15, 2016 Author Share Posted February 15, 2016 Changing the size of the bounding box and sphere doesn't fix the issue. http://www.babylonjs-playground.com/#1K8ZRL#5 http://www.babylonjs-playground.com/#1K8ZRL#7 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 16, 2016 Share Posted February 16, 2016 You have to also update submeshes bounding info: http://www.babylonjs-playground.com/#1K8ZRL#8 Or you can just force the mesh to always being selected: http://www.babylonjs-playground.com/#1K8ZRL#9 adam 1 Quote Link to comment Share on other sites More sharing options...
adam Posted February 16, 2016 Author Share Posted February 16, 2016 Thanks! 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.