eboo Posted March 14, 2016 Share Posted March 14, 2016 hi, i use a camera with parent parent is the caracter. i'd like to use LOD instead of a self drawn mesh unloader and reunloader. i'd like to use LOD with distance to parent.camera here is a sample: http://www.babylonjs-playground.com/#1DZUBR#18 i'd like to set "test" distance from parent (firebox here). Question 1: is it possible? Question 2: my script (more complexe) look like it's taking LOD "origine" on (0,0,0). but i don't know why not player, not camera. how can it be possible? Max "shown" Value used is distance from camera to parent. (this is ok) But boxes are "shown or hidden" with distance from (0,0,0) to the box. x x x 0,0,0x x x <- shown far away -> camera x <-used distance -> x target x x x sorry for my english skill Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 15, 2016 Share Posted March 15, 2016 Hey!! well done! you found a nasty bug I fixed it it should be good now Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 15, 2016 Share Posted March 15, 2016 Hi guys. http://www.babylonjs-playground.com/#1DZUBR#22 Big boxes, to little boxes, to big planes, to little planes, to out-of-sight. Working good. I thought there was still an issue, but it was an issue with ME. Thanks for the bug-find/fix, guys! Well done. Quote Link to comment Share on other sites More sharing options...
eboo Posted March 16, 2016 Author Share Posted March 16, 2016 thanks, it's working as expected but is it possible to use/modify/hack LOD system? actual system use distance between camera and knot00 my target is to use this with a "distance" similar to: var distance = (fountain.position.subtract(knot00.position)).length(); in my exemple, result would be boxes around the firebox and no element on corner. No matter how far is the camera Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 16, 2016 Share Posted March 16, 2016 This is not directly supported but you can try to hack this line: https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.mesh.ts#L234 Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 17, 2016 Share Posted March 17, 2016 Hacking is FUN! That's where the mad scientists hang-out. (heretofore... firebox == spacecraft) Eboo needs LOD... with distance... based-upon a user-settable (and possibly constantly-repositioning) origin. Cooooooool. We need this... for from-within-spacecraft views. LOD would then be based-upon distance of LOD mesh... from/to spacecraft mesh. And then we completely ignore issues with the followCam. Wow. So, eboo... (love the animated forum pic, btw)... needs to cross-offset the distance of followCam-to-spacecraft... and use THAT result ... in the computing of the LOD. err... something like that. hmm. This is a fun thing. This might lead to some framework feature-adding... yum! Quote Link to comment Share on other sites More sharing options...
eboo Posted March 17, 2016 Author Share Posted March 17, 2016 that's it var distanceToCamera = (boundingSphere ? boundingSphere : this.getBoundingInfo().boundingSphere).centerWorld.subtract(camera.globalPosition).length(); in my case should be something like if(!!camera.parent) var distanceToCamera = (boundingSphere ? boundingSphere : this.getBoundingInfo().boundingSphere).centerWorld.subtract(camera.parent.globalPosition).length(); else var distanceToCamera = (boundingSphere ? boundingSphere : this.getBoundingInfo().boundingSphere).centerWorld.subtract(camera.globalPosition).length(); 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.