Microsoft DirectX 8.1 (Visual Basic)

D3DXSkinMesh.GenerateSkinnedMesh

Generates a skinned mesh.

object.GenerateSkinnedMesh( _ 
    Options As Long, _ 
    MinWeight As Single, _ 
    AdjacencyIn As Any, _ 
    AdjacencyOut As Any) As D3DXMesh

Parts

object
Object expression that resolves to a D3DXSkinMesh object.
Options
A combination of one or more flags defined by the CONST_D3DXMESH enumeration, specifying options for the mesh.
MinWeight
Sets the minimum weight clamping value.
AdjacencyIn
First element of an array of three Long values per face that specify the three neighbors for each face in the source mesh. See Remarks.
AdjacencyOut
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.

Return Values

Returns a D3DXMesh object, representing the generated skinned mesh.

Error Codes

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

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

Remarks

This method enables you to specify all matrices and apply them to each bone. GenerateSkinnedMesh does the geometry blending for you, so you do not need to used Direct3D to do the geometry blending. In particular, this method allows more that four bone influences per vertex.

The mesh generated by this method is the one that should be supplied to D3DXSkinMesh.UpdateSkinnedMesh each time the skeleton transforms are modified.

This method is useful for skin animations.

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

Dim Opts As Long
Dim MinW As Single
Dim D3DXbAdjacencyIn As D3DXBuffer
Dim D3DXbAdjacencyOut As Any

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