Applications use the methods of the IDirect3DRMMesh interface to interact with groups of meshes. This section is a reference to the methods of this interface. For a conceptual overview, see IDirect3DRMMesh, IDirect3DRMMeshBuilder, and IDirect3DRMMeshBuilder2 Interfaces.
The methods of the IDirect3DRMMesh interface can be organized into the following groups:
| Color | GetGroupColor |
| SetGroupColor | |
| SetGroupColorRGB | |
| Creation and | AddGroup |
| information | GetBox |
| GetGroup | |
| GetGroupCount | |
| Materials | GetGroupMaterial |
| SetGroupMaterial | |
| Miscellaneous | Scale |
| Translate | |
| Rendering quality | GetGroupQuality |
| SetGroupQuality | |
| Texture mapping | GetGroupMapping |
| SetGroupMapping | |
| Textures | GetGroupTexture |
| SetGroupTexture | |
| Vertex positions | GetVertices |
| SetVertices |
The IDirect3DRMMesh interface, like all Component Object Model (COM) interfaces, inherits the IUnknown interface methods. The IUnknown interface supports the following three methods:
| AddRef |
| QueryInterface |
| Release |
In addition, the IDirect3DRMMesh interface inherits the following methods from the IDirect3DRMObject interface:
| AddDestroyCallback |
| Clone |
| DeleteDestroyCallback |
| GetAppData |
| GetClassName |
| GetName |
| SetAppData |
| SetName |
The Direct3DRMMesh object is obtained by using the IDirect3DRM::CreateMesh method.
Groups a collection of faces and retrieves an identifier for the group. The first group added to a mesh always has index 0. The index of each successive group increases by 1.
HRESULT AddGroup(
unsigned vCount,
unsigned fCount,
unsigned vPerFace,
unsigned *fData,
D3DRMGROUPINDEX *returnId
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
A newly added group has the following default properties:
To set the positions of the vertices, use the IDirect3DRMMesh::SetVertices method.
Retrieves the bounding box containing a Direct3DRMMesh object. The bounding box gives the minimum and maximum model coordinates in each dimension.
HRESULT GetBox(
D3DRMBOX * lpD3DRMBox
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the data associated with a specified group.
HRESULT GetGroup(
D3DRMGROUPINDEX id,
unsigned *vCount,
unsigned *fCount,
unsigned *vPerFace,
DWORD *fDataSize,
unsigned *fData
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the color for a group.
D3DCOLOR GetGroupColor(
D3DRMGROUPINDEX id
);
Returns a D3DCOLOR variable specifying the color if successful, or zero otherwise.
IDirect3DRMMesh::SetGroupColor, IDirect3DRMMesh::SetGroupColorRGB
Retrieves the number of groups for a given Direct3DRMMesh object.
unsigned GetGroupCount( );
Returns the number of groups if successful, or zero otherwise.
Retrieves a description of how textures are mapped to a group in a Direct3DRMMesh object.
D3DRMMAPPING GetGroupMapping(
D3DRMGROUPINDEX id
);
Returns one of the D3DRMMAPPING values that describe how textures are mapped to a group, if successful. Returns zero otherwise.
IDirect3DRMMesh::SetGroupMapping
Retrieves a pointer to the material associated with a group in a Direct3DRMMesh object.
HRESULT GetGroupMaterial(
D3DRMGROUPINDEX id,
LPDIRECT3DRMMATERIAL *returnPtr
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMMesh::SetGroupMaterial
Retrieves the rendering quality for a specified group in a Direct3DRMMesh object.
D3DRMRENDERQUALITY GetGroupQuality(
D3DRMGROUPINDEX id
);
Returns values from the enumerated types represented by D3DRMRENDERQUALITY if successful, or zero otherwise. These values include the shading, lighting, and fill modes for the object.
IDirect3DRMMesh::SetGroupQuality
Retrieves an address of the texture associated with a group in a Direct3DRMMesh object.
HRESULT GetGroupTexture(
D3DRMGROUPINDEX id,
LPDIRECT3DRMTEXTURE *returnPtr
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMMesh::SetGroupTexture
Retrieves vertex information for a specified group in a Direct3DRMMesh object.
HRESULT GetVertices(
D3DRMGROUPINDEX id,
DWORD index,
DWORD count,
D3DRMVERTEX *returnPtr
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMMesh::GetGroup, IDirect3DRMMesh::SetVertices
Scales a Direct3DRMMesh object by the given scaling factors, parallel to the x-, y-, and z-axes in model coordinates.
HRESULT Scale(
D3DVALUE sx,
D3DVALUE sy,
D3DVALUE sz
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Sets the color of a group in a Direct3DRMMesh object.
HRESULT SetGroupColor(
D3DRMGROUPINDEX id,
D3DCOLOR value
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
This method is also used to add a group color key to a Direct3DRMMeshInterpolator object.
IDirect3DRMMesh::GetGroupColor, IDirect3DRMMesh::SetGroupColorRGB
Sets the color of a group in a Direct3DRMMesh object, using individual RGB values.
HRESULT SetGroupColorRGB(
D3DRMGROUPINDEX id,
D3DVALUE red,
D3DVALUE green,
D3DVALUE blue
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
This method is also used to add a group RGB key to a Direct3DRMMeshInterpolator object.
IDirect3DRMMesh::GetGroupColor, IDirect3DRMMesh::SetGroupColor
Sets the mapping for a group in a Direct3DRMMesh object. The mapping controls how textures are mapped to a surface.
HRESULT SetGroupMapping(
D3DRMGROUPINDEX id,
D3DRMMAPPING value
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMMesh::GetGroupMapping
Sets the material associated with a group in a Direct3DRMMesh object.
HRESULT SetGroupMaterial(
D3DRMGROUPINDEX id,
LPDIRECT3DRMMATERIAL value
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMMesh::GetGroupMaterial
Sets the rendering quality for a specified group in a Direct3DRMMesh object.
HRESULT SetGroupQuality(
D3DRMGROUPINDEX id,
D3DRMRENDERQUALITY value
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMMesh::GetGroupQuality
Sets the texture associated with a group in a Direct3DRMMesh object.
HRESULT SetGroupTexture(
D3DRMGROUPINDEX id,
LPDIRECT3DRMTEXTURE value
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMMesh::GetGroupTexture
Sets the vertex positions for a specified group in a Direct3DRMMesh object.
HRESULT SetVertices(
D3DRMGROUPINDEX id,
unsigned index,
unsigned count,
D3DRMVERTEX *values
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Vertices are local to the group. If an application needs to share vertices between two different groups (for example, if neighboring faces in a mesh are different colors), the vertices must be duplicated in both groups.
This method is also used to add a vertex position key to a Direct3DRMMeshInterpolator object.
Adds the specified offsets to the vertex positions of a Direct3DRMMesh object.
HRESULT Translate(
D3DVALUE tx,
D3DVALUE ty,
D3DVALUE tz
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.