Making Lots of Little Meshes Out of One Big One

Rather than just removing vertices from your mesh, what if you actually wanted to split your one large mesh into many different pieces? Let's once again take our MeshFile example and modify it slightly to split the one large mesh into smaller, more manageable meshes.

When you split a mesh up, you will take the existing single mesh and turn it into an array of meshes that can be used to do the rendering. For this example, you will maintain both the original mesh as well as the split mesh so that you can see them both rendered and compare them.

First, you will need to declare an array of meshes to hold the split mesh. You will also need some Boolean variables to control how and which meshes are being ...

Get Managed DirectX® 9 Kick Start: Graphics and Game Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.