I'm working on a 3D game where I sometimes want to display only a cross-section of the scene. Ideally I would like this to be just the intersections of the scene with a plane. But the only way I've been able to achieve this so far is by setting the near and far culling planes to be very close together. However, there are two problems with this approach:
- The result isn't actually 2D, the cross-sections have the thickness the size of the gap between the culling planes (this isn't a huge deal, but would be nice to fix)
- Most objects become quasi-outlines since their fronts and backs are now culled by the camera. I at least want this to be filled in (e.g. for a sphere I want a solid circle instead of just an outline).
Is there a way to make a very small gap between the near and far culling planes but filling in the interior of the objects, or is there another way to achieve this plane-intersection effect?