oschakravarthi Posted November 20, 2018 Share Posted November 20, 2018 Hi, I am trying to put a hole in mesh2 as if another mesh mesh1 has fall down on mesh2 and penetrated it as shown in the attached picture. Thanks in advance. PG: https://www.babylonjs-playground.com/#QSS0FZ Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted November 20, 2018 Author Share Posted November 20, 2018 @trevordev, Can you please help me? Quote Link to comment Share on other sites More sharing options...
trevordev Posted November 20, 2018 Share Posted November 20, 2018 csg should work for this: https://playground.babylonjs.com/#T6NP3F#0 Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted November 20, 2018 Author Share Posted November 20, 2018 2 minutes ago, trevordev said: csg should work for this: https://playground.babylonjs.com/#T6NP3F#0 Yes. I have checked this. but I could not implement things like, 1. determine the position of mesh1 if it fell down on mesh2. 2. the thickness of mesh2 so that I can put a hole all thru its height. Quote Link to comment Share on other sites More sharing options...
trevordev Posted November 20, 2018 Share Posted November 20, 2018 Im not sure Im understanding, the position of it falling would just be equal to when its y value is the same as the mesh2? What do you mean thickness, with csg you can just put the object inside the other object and then cut it out. Are you trying to do this in realtime? The performance of csg is not really suited for that Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted November 20, 2018 Author Share Posted November 20, 2018 Hi @trevordev atleast, how can I do this? var floorCSG = BABYLON.CSG.FromMesh(floorMesh); var boundingInfo = new BABYLON.BoundingInfo(someMin, someMax); var boundingBox = boundingInfo.boundingBox; floorCSG.subtractInPlace(boundingBox); ///How can I do this last step? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted November 21, 2018 Share Posted November 21, 2018 Create a box with the proportion of your bounding info. and then substract but as @trevordev said, this is not really suitable for real time usage if you need to do it often. 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.