Game Development Reference
In-Depth Information
pAdjacency —Pointer to a DWORD array that contains the adja-
cency info of pMesh
pVertexAttributeWeights —Pointer to a D3DXATTRIBUTE-
WEIGHTS array of size pMesh->GetNumVertices() , where the
i th entry corresponds with the i th vertex in pMesh and specifies its
attribute weight. The attribute weights are used to determine the
chance that a vertex is removed during simplification. You can pass
in null for this parameter and a default vertex attribute weight will
be used for each vertex. See section 11.3.2 for more information on
attribute weights and the D3DXATTRIBUTEWEIGHTS structure.
pVertexWeights —Pointer to a float array of size pMesh->
GetNumVertices() , where the i th entry corresponds to the i th
vertex in pMesh and specifies its vertex weight. The higher a ver-
tex weight, the less chance it has of being removed during simplifi-
cation. You can pass in null for this parameter and a default vertex
weight of 1.0 will be used for each vertex.
MinValue —The minimum vertices or faces (determined by the
next parameter— Options ) we want to simplify down to. Note that
this value is a request, and depending on vertex/attribute weights
the resulting mesh might not match this value.
Options —Exactly one member of the D3DXMESHSIMP enumer-
ated type:
D3DXMESHSIMP_VERTEX —Specifies that the previous param-
eter MinValue refers to vertices
D3DXMESHSIMP_FACE —Specifies that the previous parameter
MinValue refers to faces
ppPMesh —Returns the generated progressive mesh
11.3.2 Vertex Attribute Weights
typedef struct _D3DXATTRIBUTEWEIGHTS {
FLOAT Position;
FLOAT Boundary;
FLOAT Normal;
FLOAT Diffuse;
FLOAT Specular;
FLOAT Texcoord[8];
FLOAT Tangent;
FLOAT Binormal;
} D3DXATTRIBUTEWEIGHTS;
The vertex weight structure allows us to specify a weight for each pos-
sible component of a vertex. A value of 0.0 would indicate that the
component carries no weight. The higher the weights for the vertex
Search WWH ::




Custom Search