Splitting up meshes

Hi,

I would like to know if a) splitting meshes (+ collider) at runtime is possible and b) if its doable while maintaining a reasonable framerate. Note that I would be splitting Unitys normal cubes. So just 24 (?) Vertices? I would just split it into 5-10 parts.

(The ultimate goal is of course to blow the mesh up :wink: )

there is piecemaker and another package whose name i forgot in the assetstore. this is rather complicated topic as you need to insert vertices, maintain the correct index order to work with culling and care about uv coordinates.

a cube has 8 vertices (if indexed).

also this could interst you: http://forum.unity3d.com/threads/85713-Boolean-Subtraction-Operations-on-Mesh

you could also model the cube in blender and then apply this extension: http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Object/Fracture and the replace the compact cube by its predefined parts.

also if you want the parts move independently you may want to make each part own game object.

I think that Obatztrara is right, a cube has 24 vertices (because different faces of the cube can not share the same normals to appear “hard edged” and even if in the modeling soft, this is 8, Unity importer splits it into 24).

You need to tesselate your mesh, and once you’re done with this, you can split it.
I would work on a triangle basis. Iterate through my triangles, and for each, generate 2 (and interpolate vertices, uvs, normals…) and fill a new mesh.