Microsoft DirectX 8.1 (Visual Basic)

D3DXSkinMesh.ConvertToIndexedBlendedMesh

Returns an indexed blended mesh.

object.ConvertToIndexedBlendedMesh( _ 
    Options As Long, _ 
    AdjacencyIn As Any, _ 
    PaletteSize As Long, _ 
    AdjacencyOut As Any, _ 
    RetNumBoneCombinations As Long, _ 
    RetBoneCombinationTable As D3DXBuffer, _
    pFaceRemap As Any, _ 
    VertexRemap As D3DXBuffer) As D3DXMesh

Parts

object
Object expression that resolves to a D3DXSkinMesh object.
Options
Combination of one or more flags defined by the CONST_D3DXMESH enumeration, specifying options for the mesh.
AdjacencyIn
First element of an array of three Long values per face that specify the three neighbors for each face in the source mesh.
PaletteSize
Palette size.
AdjacencyOut
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.
RetNumBoneCombinations
Number of entries.
RetBoneCombinationTable
First element in an array of D3DXBONECOMBINATION types. The count of types is NumBoneCombinations. Each bone combination table defines the four bones that you can draw at a time.
pFaceRemap
First element of an array, representing the destination buffer containing the new index for each face.
VertexRemap
D3DXBuffer object containing the new index for each vertex.

Return Values

Returns a D3DXMesh object, representing the blended mesh.

Error Codes

If the method fails, an error is raised and Err.Number can be set to E_OUTOFMEMORY or D3DXERR_INVALIDMESH.

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

Remarks

This method takes a skin mesh and converts it into an indexed blended mesh using the Microsoft® 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.

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

Dim Opts As Long
Dim D3DXbAdjacencyIn As D3DXBuffer
Dim PalSize as Long
Dim D3DXbAdjacencyOut As Any
Dim NumBC As Long
Dim RetTable As D3DXBuffer

' This code fragment assumes that all arguments
' have been properly initialized.
Call D3DX8.ConvertToIndexedBlendedMesh(Opts, ByVal D3DXbAdjacencyIn.GetBufferPointer, _
                                       PalSize, D3DXbAdjacencyOut, NumBC, RetTable )