Hi, I need to make dynamic mesh subtraction or simulate something like that
We got that example with sphereCSG.subtract(boxCSG).toMesh(...)
Is it possible to make this box move?
Hi, I need to make dynamic mesh subtraction or simulate something like that
We got that example with sphereCSG.subtract(boxCSG).toMesh(...)
Is it possible to make this box move?
It is, however you’ll have to recreate your CSG mesh every time the components move, which can get expensive: more nice | Babylon.js Playground (babylonjs.com)
Hi!
As @carolhmj wrote it’s an expensive operation on the CPU. However you can precalculate the meshes and just swap them. This will work only if the movement is known beforehand of course. Or you can dynamically alter the geometry, remove the unwanted vertices from the sphere based on a sphere function (available on the web) and add some or maybe @necips could came up with one. He is making incredible magic with such functions nowadays.
Very cool stuff!
I didn’t want to propose a shader based solution in the first place but imho it’s the best way to do the thing in realtime
@Necips blessing us with the coolest stuff
but yeah, I agree with the shader approach if you want realtime