Microsoft DirectX 8.0 (Visual Basic)

D3DXMesh.GenerateAdjacency

Converts point representative data stored in Microsoft® DirectX® (.x) files to face adjacency information that is more flexible for optimization and simplification operations.

object.GenerateAdjacency( _ 
    Epsilon As Single, _ 
    Adjacency As Any)

Parts

object
Object expression that resolves to a D3DXMesh object.
Epsilon
Separation distance under which vertices are welded. This parameter is currently ignored and uses an epsilon of 0.0.
Adjacency
First element of an array of Long values, representing the destination buffer for the face adjacency array of the mesh. The face adjacency is stored as an array of arrays. The innermost array is three indices of adjacent triangles, and the outer array is one set of face adjacency per triangle in the mesh. This size of this array is the maximum number of faces multiplied by 3. See Remarks.

Error Codes

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

D3DERR_INVALIDCALL
D3DXERR_INVALIDDATA
E_OUTOFMEMORY

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

Remarks

This method only logically welds the vertices and no changes are made to the mesh.

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

Dim d3dxbAdjacency As D3DXBuffer
Dim Eps As Single

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