Simplify a Mesh

This example demonstrates how to simplify a mesh.

The mesh is simplified by 25 vertices.

In the following C# code example, mesh is assumed to be a Mesh instance that has been properly loaded and cleaned, adjacency is a GraphicsStream instance that contains the mesh adjacency data, and device is the rendering Device.

SimplificationMesh simplifiedMesh = new SimplificationMesh(mesh, adjacency);

simplifiedMesh.ReduceVertices(mesh.NumberVertices - 25);

mesh = simplifiedMesh.Clone(simplifiedMesh.Options.Value, 
                            simplifiedMesh.VertexFormat, device);

Related Topics

© 2015 Microsoft