Microsoft DirectX 8.1 (Visual Basic)

D3DX8.CleanMesh

Cleans a mesh, preparing it for simplification.

object.CleanMesh( _ 
    MeshIn As D3DXMesh, _ 
    Adjacency As Any) As D3DXMesh

Parts

object
Object expression that resolves to a D3DX8 object.
MeshIn
D3DXMesh object, representing the mesh to be cleaned.
Adjacency
First element of an array of three Long values per face that specify the three neighbors for each face in the mesh to be cleaned. The same mesh is returned that was passed in if no cleaning was necessary.

Return Values

D3DXMesh object, representing the returned cleaned mesh.

Error Codes

If the method fails, an error is raised and Err.Number can be set to one of the following values.

D3DERR_INVALIDCALL
E_OUTOFMEMORY

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

This method cleans the mesh by adding another vertex where two fans of triangles share the same vertex.

The following code fragment shows how to use a D3DXBuffer object to pass adjacency information.

Dim d3dxbAdjacency As D3DXBuffer
Dim mesh As D3DXMesh

' This code fragment assumes that d3dxbAdjacency and mesh have been properly
' initialized.
Call D3DX8.CleanMesh(d3dxm, ByVal d3dxbAdjacency.GetBufferPointer)