Skip to content

Latest commit

 

History

History
95 lines (59 loc) · 2.46 KB

id3dxbasemesh--generateadjacency.md

File metadata and controls

95 lines (59 loc) · 2.46 KB
description ms.assetid title ms.topic ms.date topic_type api_name api_type api_location
ID3DXBaseMesh::GenerateAdjacency method - Generate a list of mesh edges, as well as a list of faces that share each edge.
9d52290f-1c9e-43a7-b239-35cd54e36466
ID3DXBaseMesh::GenerateAdjacency method (D3DX9Mesh.h)
reference
05/31/2018
APIRef
kbSyntax
ID3DXBaseMesh.GenerateAdjacency
COM
d3dx9.lib
d3dx9.dll

ID3DXBaseMesh::GenerateAdjacency method

Generate a list of mesh edges, as well as a list of faces that share each edge.

Syntax

HRESULT GenerateAdjacency(
  [in] FLOAT Epsilon,
  [in] DWORD *pAdjacency
);

Parameters

Epsilon [in]

Type: FLOAT

Specifies that vertices that differ in position by less than epsilon should be treated as coincident.

pAdjacency [in]

Type: DWORD*

Pointer to an array of three DWORDs per face to be filled with the indices of adjacent faces. The number of bytes in this array must be at least 3 * ID3DXBaseMesh::GetNumFaces * sizeof(DWORD).

Return value

Type: HRESULT

If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be one of the following: D3DERR_INVALIDCALL, E_OUTOFMEMORY.

Remarks

After an application generates adjacency information for a mesh, the mesh data can be optimized for better drawing performance.

The order of the entries in the adjacency buffer is determined by the order of the vertex indices in the index buffer. The adjacent triangle 0 always corresponds to the edge between the indices of the corners 0 and 1. The adjacent triangle 1 always corresponds to the edge between the indices of the corners 1 and 2 while the adjacent triangle 2 corresponds to the edge between the indices of the corners 2 and 0.

Requirements

Requirement Value
Header
D3DX9Mesh.h
Library
D3dx9.lib

See also

ID3DXBaseMesh

ID3DXMesh::Optimize

ID3DXMesh::OptimizeInplace