Microsoft DirectX 8.1 (Visual Basic) |
object.GeneratePMesh( _ Mesh As D3DXMesh, _ Adjacency As Any, _ VertexAttributeWeights As Any, _ VertexWeights As Any, _ MinValue As Long, _ Options As Long) As D3DXPMesh
D3DXPMesh object, representing the created progressive mesh.
If the method fails, an error is raised and Err.Number can be set to one of the following values.
D3DERR_INVALIDCALL |
D3DXERR_CANNOTATTRSORT |
E_OUTOFMEMORY |
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
This method generates a mesh where the level of detail (LOD) can be adjusted from the current value to the MinValue.
If the simplification process cannot reduce the mesh to MinValue, the call still succeeds, because MinValue is a desired minimum, not an absolute minimum.
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 do 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 Dim MinV As Long Dim Opts As Long ' This code fragment assumes that all arguments ' have been properly initialized. Call D3DX8.GeneratePMesh(Mesh, ByVal D3DXbAdjacency.GetBufferPointer, VAttWeights, Vweights, MinV, Opts )