Cutting up a mesh (into tiny little pieces)19 Dec 2008
A demonstration of splitting a mesh in two along an arbitrary plane. With some faux-physics for added value. I was thinking about the 'laser room scene' in Resident Evil.
This minimal example shows how to cut up the faces of a mesh along a plane:
This serves as the foundation for everything else in this demo, and for the following ideas which I think would be nice to see executed in Flash.
- Making a more advanced intersection test using rectangles (which are bounded) instead of planes (which are infinite). The additional control would open up all sorts of fun possibilities. Projectiles or edge weapons hitting targets that get cleaved in half...
- Adding extra faces to the cut-up meshes to make them closed shapes again would make the whole thing feel more "physical" and less abstract-graphics-demoey. And make it more useful for practical applications.
- Maybe adding the ability to cut along an arbitrary path made up of connected line segments (like a cookie cutter)...
Make sure to try resetting the scene, pausing (with spacebar), clicking through a mesh several times, and then unpausing..
Oh yeah, and the usual disclaimer/apologies about how much this demo hates your CPU, and how unoptimized it is (e.g., right now every face in the scene is tested against the plane with every click (ouch!)). Built with the most recent revision of Papervision 3D.