SimplificationMesh.Clone Method

Language:

How Do I...?

Clones, or copies, a SimplificationMesh object.

Definition

Visual Basic Public Function Clone( _
    ByVal options As MeshFlags, _
    ByVal vertexFormat As VertexFormats, _
    ByVal device As Device _
) As Mesh
C# public Mesh Clone(
    MeshFlags options,
    VertexFormats vertexFormat,
    Device device
);
C++ public:
MeshClone(
    MeshFlags options,
    VertexFormats vertexFormat,
    Devicedevice
);
JScript public function Clone(
    options : MeshFlags,
    vertexFormat : VertexFormats,
    device : Device
) : Mesh;

Parameters

options Microsoft.DirectX.Direct3D.MeshFlags
Mesh creation options, indicated through one or more MeshFlags flags (excepting the Simplify* and Optimize* flags).
vertexFormat Microsoft.DirectX.Direct3D.VertexFormats
Vertex format of the mesh, indicated by one or more VertexFormats members.
device Microsoft.DirectX.Direct3D.Device
The Device object associated with the mesh.

Return Value

Microsoft.DirectX.Direct3D.Mesh
Address of a pointer to a Mesh object that represents the cloned mesh.

Remarks

Exceptions
InvalidCallException The method call is invalid. For example, a method's parameter might contain an invalid value.
OutOfMemoryException Leave 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


Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center