jerome Posted December 14, 2016 Share Posted December 14, 2016 http://www.babylonjs-playground.com/#WOFCL#6 A little green box is set at the first facet location.. the first facet found in the local mesh octree block where the red ball is currently located In this example, the octree is 10 x 10 x 10 blocks and has a very simple and naive implementation. This could be improved easily. Moreover, the octree number of subdivisions could be automaticaly computed from some ratio between the mesh total facet number and its size or the facet average area... (maybe it's still buggy, it's only a prototype coded Q&D) [EDIT] http://www.babylonjs-playground.com/#WOFCL#7 the octree number of subdivision is now pow(nbFacets, 1/3) so it automatically scales to the mesh geometry. I just hope it's a good value :-D [EDIT] maybe a better number sqrt(nbFacets / 6) ... for 6 sides on a box http://www.babylonjs-playground.com/#WOFCL#8 works sometimes well : http://www.babylonjs-playground.com/#WOFCL#9 but not that well with the cylinder mesh. Still buggy 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.