Cutting up a mesh (into tiny little pieces)
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, LOL.
I’ve included the source code of a minimal example showing how to cut up the faces of a mesh along a plane:
PlaneSplitMinimalExample.as | compiled swf
This is the foundation for everything in this demo, and for the following ideas which I think would be nice to see executed in Flash–
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.
Also, apologies for the long hiatus.
UPDATE: John Lindquist has kindly pointed out there’s already a helper function in the Papervision framework for cutting meshes with planes! – MeshUtil.cutTriangleMesh().
Licensed under a Creative Commons Attribution 3.0 License.

December 19th, 2008 at 11:21 pm
Love it as allways!:) Have fun in NYC.
December 20th, 2008 at 9:18 am
Excellent work and thanks for the source.