Microsoft DirectX 8.1 (Visual Basic)

D3DXPMesh.SetNumFaces

Sets the current level of detail to as close to the specified number of faces as possible.

object.SetNumFaces( _ 
    Faces As Long)

Parts

object
Object expression that resolves to a D3DXPMesh object.
Faces
Target number of faces. This value specifies the desired change in the level of detail (LOD).

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

If the number of faces is greater than the maximum number of faces, it is capped at the maximum number of faces returned by D3DXPMesh.GetMaxFaces. If the number of faces is less than the minimum number of faces, it is capped at the minimum number of faces returned by D3DXPMesh.GetMinFaces.

The number of faces after this call might be off by one because some edge collapse might introduce or remove one face or two. For example, if you try setting the number of faces to an intermediate value such as 5, when 4 and 6 are possible, 4 is always the result.