Here is my 3D triangle-based constructive solid geometry unit: http://rootserver.rosseaux.net/stuff/BeRoCSGBSP.pas just replace the GDFWMath 3D math stuff with your own 3D math library stuff.