Microsoft DirectX 8.0 (C++)

ID3DXMesh::ConvertPointRepsToAdjacency

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

HRESULT ConvertPointRepsToAdjacency(
  CONST DWORD* pPRep,
  DWORD* pAdjacency
);

Parameters

pPRep
[in] Pointer to the point representatives for the mesh. The point representatives are stored as an array of indices with one element per vertex.
pAdjacency
[in, out] Pointer to a 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.

Return Values

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be one of the following values.

D3DERR_INVALIDCALL
E_OUTOFMEMORY

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, an 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.

Requirements

  Header: Declared in D3dx8mesh.h.
  Import Library: Use D3dx8.lib.

See Also

ID3DXMesh::ConvertAdjacencyToPointReps