cclark440 Posted December 12, 2017 Share Posted December 12, 2017 I have been trying to figure out the subtracting. I figured out how to create a new mesh , ( the large green cylinder), that has the subtracted portion of two other meshes but, I can't figure out how to just subtract part 2 ( the small green cylinder) from part 1, ( the large white cylinder) in place. Is it possible to create the subtracting geometry without ever rendering it? I have spent a s fair amount of time trying to figure this out on my own. I just haven't found an example that seems to be what I need or, I am looking in the wrong places? http://www.babylonjs-playground.com/#1RWE59#93 As usual any and all help would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 12, 2017 Share Posted December 12, 2017 You can't do it in place but you can do it on mesh with setEnabled set to false https://www.babylonjs-playground.com/#1RWE59#95 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted December 12, 2017 Share Posted December 12, 2017 1 hour ago, cclark440 said: Is it possible to create the subtracting geometry without ever rendering it? var subCSG = CSGStem.subtract(wHole); var mesh = subCSG.toMesh("csg",myMaterial,scene); // this is the geometry, but it's a private property, so not supported. var geometry = mesh._geometry; // you can apply this geometry to other meshes: geometry.applyToMesh(otherMesh); edit: adam has correctly pointed out we should be using the geometry property (without underscore)! Pryme8 1 Quote Link to comment Share on other sites More sharing options...
adam Posted December 12, 2017 Share Posted December 12, 2017 use geometry without an underscore: http://playground.babylonjs.com/#4QLJ5D brianzinn 1 Quote Link to comment Share on other sites More sharing options...
cclark440 Posted December 13, 2017 Author Share Posted December 13, 2017 Thanks for the Help guys! 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.