October 2022
Posted 2 years ago
Being able to easily live-edit geometry would open up a ton of possibilities when making games. To that end, I've built a simple toolset based around constructive solid geometry.
You can add and subtract brush shapes with arbitrary materials like this:
var world = new CsgSolid(); world.Add( CubeBrush, DefaultMaterial, position: Vector3.Up * 512f, scale: new Vector3( 8192f, 8192f, 1024f ) ); world.Subtract( DodecahedronBrush, position: Vector3.Up * 1024f, scale: new Vector3( 1024f, 1024f, 512f ), rotation: Rotation.FromYaw( 45f ) );
Check out CSG Demo in-game to play around with what we have so far. My CSG library is available on GitHub if you already want to start integrating it into your own games, although be aware that it's still pretty experimental.