Vesmy Posted November 18, 2017 Share Posted November 18, 2017 I need to create very large scene (there are meshes with size 10, but also with 10^6). It requires set: camera.maxZ = Math.pow(10, 10) But then is not working pickedMesh (pickedMesh is always null): scene.pick(scene.pointerX, scene.pointerY).pickedMesh Is there any way to use very large camera visibility with functional pickedMesh? Here is demo. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted November 18, 2017 Share Posted November 18, 2017 good question. I tried your PG with a couple of changes to see if it would make a difference, but it didn't:http://www.babylonjs-playground.com/indexstable#M5Z1R9#2 It works till distance 3350000 and not at 3360000, although not very accurate at that distance. I have noticed this before with BABYLON.Ray(), which defaults to 100. I wonder if it is some optimisation, but I can't find it. Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted November 18, 2017 Share Posted November 18, 2017 Babylon.ray defaults to Number.MAX_VALUE if no length is given No idea what's wrong with the PG through. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted November 18, 2017 Share Posted November 18, 2017 Thanks for the correction @aWeirdo, Ray is Number.MAX_VALUE. It's camera.getForwardRay() that is limited to 100 by default (https://github.com/BabylonJS/Babylon.js/blob/9824853960fc2a4be97b1acb6907244c8df9f05e/src/Cameras/babylon.camera.ts#L553) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 20, 2017 Share Posted November 20, 2017 We are hitting a math limitation here I would highly suggest to create your scene with smaller number and just apply a function to move from the 3d representation to the data world For instance if in your simulation a mesh has to be a 10^7 then just consider that it will be at 10^3 so the function to move from one world to another is x / 10^4 Quote Link to comment Share on other sites More sharing options...
Vesmy Posted November 23, 2017 Author Share Posted November 23, 2017 @Deltakosh Thanks for answer, but I have another problem with this. I need render our galaxy Milky Way and our planet Earth abreast. Milky Way has diameter 100 000 light years (it's 946 100 000 000 000 000 km), and Earth has diameter 12 756 km. So, when Milky Way is 10^5 Babylon's size-units long, my function is x / 10^14. Then Earth must have 10^(-9) Babylon's size-units. Unfortunately, Earth is not visible (even if I zoom it), and if I set: camera.minZ = Math.pow(10, -9) there is same problem as when I set big maxZ - pointer events are not called on mesh. Any idea how to do this? 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.