SimplificationMesh.Clone Method ()

How Do I...?

  • Simplify a Mesh

Clones, or copies, a SimplificationMesh object.

Overload List

public Mesh Clone(MeshFlags, VertexElement[], Device);
public Mesh Clone(MeshFlags, VertexElement[], Device, out int, out int);
public Mesh Clone(MeshFlags, VertexFormats, Device);
public Mesh Clone(MeshFlags, VertexFormats, Device, out int, out int);

Remarks

Exceptions

InvalidCallException

The method call is invalid. For example, a method's parameter might contain an invalid value.

OutOfMemoryExceptionLeave Site

Microsoft Direct3D could not allocate sufficient memory to complete the call.

How Do I...?

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.

              [C#]
              

SimplificationMesh simplifiedMesh = new SimplificationMesh(mesh, adjacency);

simplifiedMesh.ReduceVertices(mesh.NumberVertices - 25);

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

See Also