Microsoft DirectX 8.1 (C++)

ID3DXSkinMesh::ConvertToIndexedBlendedMesh

Returns an indexed blended mesh.

HRESULT ConvertToIndexedBlendedMesh(
  DWORD Options,
  CONST LPDWORD pAdjacencyIn,
  DWORD PaletteSize,
  LPDWORD pAdjacencyOut,
  DWORD* pNumBoneCombinations
  LPD3DXBUFFER* ppBoneCombinationTable
  DWORD* pFaceRemap,
  LPD3DXBUFFER* ppVertexRemap,
  LPD3DXMESH* ppMesh,
);

Parameters

Options
[in] This flag specifies creation options for the mesh. It can be any combination of flags from both the D3DXMESH enumeration or the D3DXMESHOPT enumeration (except for D3DXMESHOPT_IGNOREVERTS or D3DXMESHOPT_SHAREVB).
pAdjacencyIn
[in] Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the source mesh.
PaletteSize
[in] The palette size.
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.
pNumBoneCombinations
[in, out] Number of entries.
ppBoneCombinationTable
[in, out] Address of a pointer to an array of D3DXBONECOMBINATION structures. The count of structures is pNumBoneCombinations. Each bone combination table defines the four bones that you can draw at a time.
pFaceRemap
[in, 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.
ppMesh
[in, out] Address of a pointer to an ID3DXMesh interface, representing the indexed blended 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:

E_OUTOFMEMORY
D3DERR_INVALIDCALL
D3DERR_INVALIDMESH
D3DXERR_TOOMANYINFLUENCES

Remarks

This method takes a skin mesh and converts it into an indexed blended mesh using the Direct3D indexed vertex blending functionality. Indexed vertex blending uses indices to index into a matrix palette. For more information, see Geometry Blending. Converting a skin mesh into an indexed blended mesh enables you to render the mesh in a single drawing call.

Requirements

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