IDirect3DRMMesh::AddGroup

HRESULT AddGroup(unsigned vCount, unsigned fCount,

unsigned vPerFace, unsigned *fData, D3DRMGROUPINDEX *returnId);

Groups a collection of faces and retrieves an identifier for the group.

·Returns D3DRM_OK if successful, or an error otherwise. For a list of possible return codes, see Direct3D Retained-Mode Return Values.

vCount and fCount

Number of vertices and faces in the group.

vPerFace

Number of vertices per face in the group, if all faces have the same vertex count. If the group contains faces with varying vertex counts, this parameter should be zero.

fData

Address of face data. If the vPerFace parameter specifies a value, this data is simply a list of indices into the group's vertex array. If vPerFace is zero, the vertex indices should be preceded by an integer giving the number of vertices in that face. For example, if vPerFace is zero and the group is made up of triangular and quadrilateral faces, the data might be in the following form: 3 index index index 4 index index index index 3 index index index ...

returnId

Address of a variable that will identify the group when the method returns.

A newly added group has the following default properties:

·White

·No texture

·No specular reflection

·Position, normal, and color of each vertex in the vertex array equal to zero

To set the positions of the vertices, use the IDirect3DRMMesh::SetVertices method.