Microsoft DirectX 8.1 (C++) |
Generates a simplified mesh using the provided weights that come as close as possible to the given MinValue.
HRESULT D3DXSimplifyMesh( LPD3DXMESH pMesh, CONST DWORD* pAdjacency, CONST LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights, CONST FLOAT* pVertexWeights, DWORD MinValue, DWORD Options, LPD3DXMESH* ppMesh );
If the function succeeds, the return value is D3D_OK.
If the function fails, the return value can be one of the following values.
D3DERR_INVALIDCALL |
D3DXERR_INVALIDDATA |
E_OUTOFMEMORY |
This function generates a mesh that has minValue vertices or faces.
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 pVertexAttributeWeights is set to NULL, the following values are assigned to the default D3DXATTRIBUTEWEIGHTS structure.
D3DXATTRIBUTEWEIGHTS AttributeWeights; AttributeWeights.Position = 1.0; AttributeWeights.Boundary = 1.0; AttributeWeights.Normal = 1.0; AttributeWeights.Diffuse = 0.0; AttributeWeights.Specular = 0.0; AttributeWeights.Tex[8] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
This default structure 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.
Header: Declared in D3dx8mesh.h.
Import Library: Use D3dx8.lib.