Microsoft DirectX 8.1 (Visual Basic) |
Creates a simplification mesh.
object.CreateSPMesh( _ Mesh As D3DXMesh, _ Adjacency As Any, _ VertexAttributeWeights As Any, _ VertexWeights As Any) As D3DXSPMesh
D3DXSPMesh object, representing the created simplification mesh.
If the method fails, an error is raised and Err.Number can be set to one of the following values.
D3DXERR_CANNOTATTRSORT |
D3DERR_INVALIDCALL |
E_OUTOFMEMORY |
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
A simplification mesh is used to simplify a mesh to a lower number of triangles and faces.
If VertexAttributeWeights is set to ByVal 0, the values are assigned according to the default D3DXATTRIBUTEWEIGHTS type.
Dim AttribruteWeights As D3DXATTRIBUTEWEIGHTS With _ .position = 1 .Boundary = 1 .Normal = 1 .diffuse = 0 .specular = 0 .Tex(7) = 0 End With
This default type is what most applications should use because it considers only geometric and normal adjustment. Only in special cases will the other member fields need to be modified.
The following code fragment shows how to use a D3DXBuffer object to pass adjacency information.
Dim Mesh As D3DXMesh Dim D3DXbAdjacency As D3DXBuffer Dim VAttWeights As Any Dim VWeights As Any ' This code fragment assumes that all arguments ' have been properly initialized. Call D3DX8.CreateSPMesh(Mesh, ByVal D3DXbAdjacency.GetBufferPointer, VAttWeights, Vweights )