?/TD>
Microsoft DirectX 9.0

D3DXWeldVertices Function


Welds together replicated vertices that have equal attributes. This method uses specified epsilons for equality comparisons.

Syntax

HRESULT D3DXWeldVertices(      

    const LPD3DXMESH pMesh,     DWORD Flags,     CONST D3DXWELDEPSILONS* pEpsilon,     CONST DWORD* pAdjacencyIn,     DWORD* pAdjacencyOut,     DWORD* pFaceRemap,     LPD3DXBUFFER* ppVertexRemap );

Parameters

pMesh
[in] Pointer to an ID3DXMesh object, the mesh from which to weld vertices.
Flags
[in] Combination of one or more flags from D3DXMESH.
pEpsilon
[in] Pointer to a D3DXWELDEPSILONS structure, specifying the epsilon values to be used for this method.
pAdjacencyIn
[in] Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the source mesh. If the edge has no adjacent faces, the value is 0xffffffff. If this parameter is set to NULL, ID3DXBaseMesh::GenerateAdjacency will be called to create logical adjacency information.
pAdjacencyOut
[in, out] Pointer to a destination buffer for the face adjacency array of the optimized 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.
pFaceRemap
[out] Pointer to a destination buffer containing the new index for each face.
ppVertexRemap
[out] Address of a pointer to an ID3DXBuffer interface, containing the new index for each vertex.

Return Value

If the function succeeds, the return value is D3D_OK.

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

D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.
E_OUTOFMEMORYMicrosoft?Direct3D?could not allocate sufficient memory to complete the call.


Remarks

This method uses the provided adjacency information to determine the points that are replicated. This method uses an epsilon compare to merge vertices, and requires vertices with equal position to already have been calculated and represented by point-representative data.

This method takes logically welded vertices and combines the ones that have similar components, such as normals within pEpsilon or texture coordinates within pEpsilon.

Function Information

Headerd3dx9mesh.h
Import libraryd3dx9.lib
Minimum operating systems Windows 98


© 2002 Microsoft Corporation. All rights reserved.