waverider Posted January 27, 2018 Share Posted January 27, 2018 Hy there! I used a heightmap displacement on the sphere, i turned the scene collision on and checked collision for the displaced mesh but the camera doesn't collide with it. thinking maybe it has something to do with the bounding box, here's a pg: https://www.babylonjs-playground.com/#5CT9MA Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 27, 2018 Share Posted January 27, 2018 you can make parent box and use that there are some other option like GPU pick or make geometry from height Map that can help too but need implemented for your sample waverider and Wingnut 2 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted January 27, 2018 Share Posted January 27, 2018 Hi guys. I did some experimenting: https://www.babylonjs-playground.com/#5CT9MA#1 Let's see... I added two functions to Mesh class... .setEllipsoidPerBoundingBox() and .showEllipsoid().. up at the top of the PG. I made sure camera.checkCollisions = true was set in line 45. I did the same for Polyhedron... in line 160. I stopped at lines 161/162 and thought about them. Lines 165-168... manually set a boundingBox size that surrounded the mesh... by trial and error. Lines 171-172... called my two custom functions. They appear to work... but are experimental and subject to bugs. Lines 174-179... did a bunch of dumps to console... where I realized that camera had no ._collider, so I added one. Used code from https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/babylon.freeCamera.ts#L150 as example. Result: Nothing changed. Total failure. No sign of camera-to-Polyhedron colliding at all. hrmf! What the heck?! I'll keep testing and thinking. I'm currently using Firefox ESR (which is a 52.6.0 non-Quantum, so plugins still work.) I advise ALL to use Firefox ESR instead of v57+. I think ESR will be supported for at least a year, and that gives the (ad blocker) plugin authors... time to convert their plugins to "webExtensions API". Trying to use almost ANY firefox plugin... with Firefox 58... will cause playground, webGL scenes, and the BJS forum website... to fail... and with nearly ZERO indications of WHY. Be careful. It made me pretty scared and aggravated... 2 days ago. NasimiAsl and waverider 1 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 27, 2018 Share Posted January 27, 2018 hi wingnut Moderator-inserted text: Heya Naz... how ya been? I hope well. Happy weekend! Wingnut 1 Quote Link to comment Share on other sites More sharing options...
waverider Posted January 27, 2018 Author Share Posted January 27, 2018 @NasimiAsl how does the gpu pick work? Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 28, 2018 Share Posted January 28, 2018 most make it again after some update that not work ( it is not work for webgl2 i think ) need make new sample waverider 1 Quote Link to comment Share on other sites More sharing options...
waverider Posted January 28, 2018 Author Share Posted January 28, 2018 Coool!!! Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 28, 2018 Share Posted January 28, 2018 https://www.babylonjs-playground.com/#JAG8B#18 @waverider ask any thing more about this i am not optimize this pick system yet and don't make it like tools for BJS but that have some benefits 1. you can detect any pixel of mesh no need separate or make more 2. that is not important how much complicated geometry you have or heavy vertex that is 3. you can use parallel camera with different directions in each frame (i test one time 32 x 32 camera for medium graphic card you can see how that implemented 4. you can ignore some pixel of mesh by 'discard' 5. you can detect back face when that back face is enabled https://www.babylonjs-playground.com/#JAG8B#19 and have some problem too like 1. that is very new technic for pick so you don't have so much tools in BJS for config that easily 2. just detect One mesh in each ray 3. we have not face information 4. not optimization for yet 5. not have any more information like distance or 3d position or normal or ... (maybe we can have it in in future ) i recommend that for all system with good graphic card ( if you write a project for Game ) GameMonetize and Wingnut 2 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.