Microsoft DirectX 8.0 (Visual Basic)

D3DXMesh.ConvertAdjacencyToPointReps

Generates point representatives for the mesh.

object.ConvertAdjacencyToPointReps( _ 
    Adjacency As Any, _ 
    PointRep As Any)

Parts

object
Object expression that resolves to a D3DXMesh object.
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
PointRep
First element of an array of Long values, representing the point representatives for the mesh. The point representatives are stored as an array of indices with one element per vertex. The size of this array is the number of vertices in the mesh. You can specify ByVal 0 for this parameter, if the vertices do not need to be relabeled.

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_INVALIDMESH
E_OUTOFMEMORY

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

Remarks

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

Dim D3DXbAdjacency As D3DXBuffer
Dim PointRep As Any

' This code fragment assumes that D3DXbAdjacencyand PointRep have been properly
' initialized.
Call D3DX8.ConvertPointRepsToAdjacency(ByVal D3DXbAdjacency.GetBufferPointer, PointRep)

Remarks

Point representatives are a method of describing mesh adjacency by fusing two vertices with the same x-, y-, and z- coordinates but with different normal coordinates, u- and v-coordinates, color data, and so on. In a perfectly smooth mesh (a mesh without creases, boundaries, or holes), point representatives are redundant. In that case, it is possible to compute adjacent triangles by using a hash table to locate edges that share vertex indices. In the case of creases and texture boundaries, the point representatives are required to give a unique vertex index to use in a hash table for a group of co-located vertices that make up a vertex in the mesh.

See Also

D3DXMesh.ConvertPointRepsToAdjacency