Applications use the methods of the IDirect3DRMFace interface to interact with a single polygon in a mesh. This section is a reference to the methods of this interface. For a conceptual overview, see IDirect3DRMFace and IDirect3DRMFaceArray Interfaces.
The methods of the IDirect3DRMFace interface can be organized into the following groups:
The IDirect3DRMFace 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 IDirect3DRMFace interface inherits the following methods from the IDirect3DRMObject interface:
| AddDestroyCallback |
| Clone |
| DeleteDestroyCallback |
| GetAppData |
| GetClassName |
| GetName |
| SetAppData |
| SetName |
The Direct3DRMFace object is obtained by using the IDirect3DRM::CreateFace method.
Adds a vertex to a Direct3DRMFace object.
HRESULT AddVertex(
D3DVALUE x,
D3DVALUE y,
D3DVALUE z
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Adds a vertex and a normal to a Direct3DRMFace object, using an index for the vertex and an index for the normal in the containing mesh builder. The face, vertex, and normal must already be part of a Direct3DRMMeshBuilder object.
HRESULT AddVertexAndNormalIndexed(
DWORD vertex,
DWORD normal
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the color of a Direct3DRMFace object.
D3DCOLOR GetColor( );
Returns the color.
Retrieves the material of a Direct3DRMFace object.
HRESULT GetMaterial(
LPDIRECT3DRMMATERIAL* lplpMaterial
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the normal vector of a Direct3DRMFace object.
HRESULT GetNormal(
D3DVECTOR *lpNormal
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the Direct3DRMTexture object applied to a Direct3DRMFace object.
HRESULT GetTexture(
LPDIRECT3DRMTEXTURE* lplpTexture
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the index of the vertex for texture coordinates in the face's mesh. You pass in the face-relative vertex index in the which parameter, and this method returns the corresponding mesh-relative vertex index.
int GetTextureCoordinateIndex(
DWORD which
);
Returns the face's mesh-relative vertex index.
Retrieves the texture coordinates of a vertex in a Direct3DRMFace object.
HRESULT GetTextureCoordinates(
DWORD index,
D3DVALUE *lpU,
D3DVALUE *lpV
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the texture topology of a Direct3DRMFace object.
HRESULT GetTextureTopology(
BOOL *lpU,
BOOL *lpV
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFace::SetTextureTopology
Retrieves the position and normal of a vertex in a Direct3DRMFace object.
HRESULT GetVertex(
DWORD index,
D3DVECTOR *lpPosition,
D3DVECTOR *lpNormal
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the number of vertices in a Direct3DRMFace object.
int GetVertexCount( );
Returns the number of vertices.
Retrieves the index of the vertex in the face's mesh. You pass in the face-relative vertex index in the which parameter, and this method returns the corresponding mesh-relative vertex index.
int GetVertexIndex (
DWORD which
);
Returns the mesh-relative vertex index.
Retrieves the position and normal vector of each vertex in a Direct3DRMFace object.
HRESULT GetVertices(
DWORD *lpdwVertexCount,
D3DVECTOR *lpPosition,
D3DVECTOR *lpNormal
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Sets a Direct3DRMFace object to a given color.
HRESULT SetColor(
D3DCOLOR color
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Sets a Direct3DRMFace object to a given color.
HRESULT SetColorRGB(
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.
Sets the material of a Direct3DRMFace object.
HRESULT SetMaterial(
LPDIRECT3DRMMATERIAL lpD3DRMMaterial
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Sets the texture of a Direct3DRMFace object.
HRESULT SetTexture(
LPDIRECT3DRMTEXTURE lpD3DRMTexture
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Sets the texture coordinates of a specified vertex in a Direct3DRMFace object.
HRESULT SetTextureCoordinates(
DWORD vertex,
D3DVALUE u,
D3DVALUE v
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Sets the texture topology of a Direct3DRMFace object.
HRESULT SetTextureTopology(
BOOL cylU,
BOOL cylV
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFace::GetTextureTopology
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.