Microsoft DirectX 9.0 SDK Update (October 2004)

Mesh.Simplify Method

Language:

Note: This documentation is preliminary and is subject to change.

Generates a simplified mesh using the provided weights that come as close as possible to the given minValue.

Definition

Visual Basic .NET Public Shared Function Simplify( _
    ByVal mesh As Mesh, _
    ByVal adjacency As GraphicsStream, _
    ByVal vertexAttributeWeights As AttributeWeights, _
    ByVal vertexWeights As GraphicsStream, _
    ByVal minValue As Integer, _
    ByVal options As MeshFlags _
) As Mesh
C# public static Mesh Simplify(
    Mesh mesh,
    GraphicsStream adjacency,
    AttributeWeights vertexAttributeWeights,
    GraphicsStream vertexWeights,
    int minValue,
    MeshFlags options
);
Managed C++ public: static Mesh* Simplify(
    Mesh *mesh,
    GraphicsStream *adjacency,
    AttributeWeights vertexAttributeWeights,
    GraphicsStream *vertexWeights,
    int minValue,
    MeshFlags options
);
JScript .NET public static function Simplify(
    mesh : Mesh,
    adjacency : GraphicsStream,
    vertexAttributeWeights : AttributeWeights,
    vertexWeights : GraphicsStream,
    minValue : int,
    options : MeshFlags
) : Mesh;

Parameters

mesh Microsoft.DirectX.Direct3D.Mesh. A Mesh object that represents the source mesh.
adjacency Microsoft.DirectX.GraphicsStream. Array of three Int32 Leave Site values per face that specify the three neighbors for each face in the mesh to be simplified.
vertexAttributeWeights Microsoft.DirectX.Direct3D.AttributeWeights. An AttributeWeights structure that contains the weight for each vertex component. If this parameter is omitted, a default structure is used. See Remarks.
vertexWeights Microsoft.DirectX.GraphicsStream. A GraphicsStream of vertex weights. If this parameter is set to 0, all vertex weights are set to 1.0.
minValue System.Int32. Number of vertices or faces, depending on the flag set in the options parameter, by which to simplify the source mesh.
options Microsoft.DirectX.Direct3D.MeshFlags. Simplification options for the mesh; can be one of the Simplify* flags in MeshFlags.

Return Value

Microsoft.DirectX.Direct3D.Mesh . A Mesh object that represents the returned simplification mesh.

Remarks

This method generates a mesh that has minValue vertices or faces.

If the simplification process cannot reduce the mesh to minValue, the call still succeeds, because minValue is a desired minimum, not an absolute minimum.

If vertexAttributeWeights is omitted, the following values are assigned to the default AttributeWeights structure (C# code shown).

[C#]
AttributeWeights aWeights; aWeights.Position = 1.0; aWeights.Boundary = 1.0; aWeights.Normal = 1.0; aWeights.Diffuse = 0.0; aWeights.Specular = 0.0; aWeights.Tex[8] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};

This default structure is what most applications should use, because it considers only geometric and normal adjustment. Only in special cases will the other member fields need to be modified.

Exceptions
InvalidCallException The method call is invalid. For example, a method's parameter might contain an invalid value.
InvalidDataException The data is invalid.
OutOfMemoryException Leave Site Microsoft® Direct3D® could not allocate sufficient memory to complete the call.


© 2004 Microsoft Corporation. All rights reserved. Terms of use.

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