I’m looking for a library with which I can create 3d shapes at runtime and render them in MonoGame. These shapes cannot be pre-built and just loaded as an asset, they must be created dynamically. It should support basic operations like Merge, Intersect, Subtract.
Let’s say I want to create a cube with a spherical cut-out.
The code could look something like this (simplified):
builder.Add(new Cube(x, y, z, w, h, d))
builder.Subtract(new Sphere(x, y, z, r))
builder.Triangulate();
// ....
GraphicsDevice.DrawUserIndexedPrimitives(....) // use builder output as parameters
Performance is not a huge concern, I won’t create a million slightly different shapes, but rather a few specific visible shapes at a time that can only be known at runtime.
Can you recommend / do you have experience with a library which is suited for MonoGame? It doesn’t have to be MonoGame-specific as long as the “conversion” from its output to commands like .DrawUserIndexedPrimitives() is possible