## IDirect3DRMMeshBuilder2

Applications use the methods of the IDirect3DRMMeshBuilder2 interface to interact with mesh objects. IDirect3DRMMeshBuilder2 has the same functionality as IDirect3DRMMeshBuilder and in addition has extended the IDirect3DRMMeshBuilder2::GenerateNormals2 method to give greater control over the mesh normals generated. IDirect3DRMMeshBuilder2 also allows you to retrieve a single mesh face with IDirect3DRMMeshBuilder2::GetFace.

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 IDirect3DRMMeshBuilder2 interface can be organized into the following groups:

Color | GetColorSource
| SetColor
| SetColorRGB
| SetColorSource
Creation | GetBox
Faces | AddFace
| AddFaces
| CreateFace
| GetFaceCount
| GetFace
| GetFaces
Loading | Load
Meshes | AddMesh
| CreateMesh
Miscellaneous | AddFrame
| AddMeshBuilder
| ReserveSpace
| Save
| Scale
| SetMaterial
| Translate
Normals | AddNormal
| GenerateNormals2
| SetNormal
Perspective | GetPerspective
| SetPerspective
Rendering quality | GetQuality
| SetQuality
Textures | GetTextureCoordinates
| SetTexture
| SetTextureCoordinates
| SetTextureTopology
Vertices | AddVertex
| GetVertexColor
| GetVertexCount
| GetVertices
| SetVertex
| SetVertexColor
| SetVertexColorRGB

The IDirect3DRMMeshBuilder2 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 IDirect3DRMMeshBuilder2 interface inherits the following methods from the IDirect3DRMObject interface:

AddDestroyCallback
Clone
DeleteDestroyCallback
GetAppData
GetClassName
GetName
SetAppData
SetName

The Direct3DRMMeshBuilder2 object is obtained by using the IDirect3DRM::CreateMeshBuilder method.

###

IDirect3DRMMeshBuilder2::AddFace

IDirect3DRMMeshBuilder2

Adds a face to a Direct3DRMMeshBuilder2 object.

HRESULT AddFace(
LPDIRECT3DRMFACE lpD3DRMFace
);

##### Parameters

lpD3DRMFace
  Address of the face being added.

##### Return Values

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

##### Remarks

Any one face can exist in only one mesh at a time.

###

IDirect3DRMMeshBuilder2::AddFaces

IDirect3DRMMeshBuilder2

Adds faces to a Direct3DRMMeshBuilder2 object.

HRESULT AddFaces(
DWORD dwVertexCount,
D3DVECTOR * lpD3DVertices,
DWORD normalCount,
D3DVECTOR *lpNormals,
DWORD *lpFaceData,
LPDIRECT3DRMFACEARRAY* lplpD3DRMFaceArray
);

##### Parameters

dwVertexCount
  Number of vertices.
lpD3DVertices
  Base address of an array of D3DVECTOR structures that stores the vertex positions.
normalCount
  Number of normals.
lpNormals
  Base address of an array of D3DVECTOR structures that stores the normal positions.
lpFaceData
  For each face, this parameter should contain a vertex count followed by the indices into the vertices array. If normalCount is not zero, this parameter should contain a vertex count followed by pairs of indices, with the first index of each pair indexing into the array of vertices, and the second indexing into the array of normals. The list of indices must terminate with a zero.
lplpD3DRMFaceArray
  Address of a pointer to an IDirect3DRMFaceArray interface that will be filled with a pointer to the newly created faces.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::AddFrame

IDirect3DRMMeshBuilder2

Adds the contents of a frame to a Direct3DRMMeshBuilder2 object.

HRESULT AddFrame(
LPDIRECT3DRMFRAME lpD3DRMFrame
);

##### Parameters

lpD3DRMFrame
  Address of the frame whose contents are being added.

##### Return Values

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

##### Remarks

The source frame is not modified or referenced by this operation.

###

IDirect3DRMMeshBuilder2::AddMesh

IDirect3DRMMeshBuilder2

Adds a mesh to a Direct3DRMMeshBuilder2 object.

HRESULT AddMesh(
LPDIRECT3DRMMESH lpD3DRMMesh
);

##### Parameters

lpD3DRMMesh
  Address of the mesh being added.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::AddMeshBuilder

IDirect3DRMMeshBuilder2

Adds the contents of a Direct3DRMMeshBuilder object to a Direct3DRMMeshBuilder2 object.

HRESULT AddMeshBuilder(
LPDIRECT3DRMMESHBUILDER lpD3DRMMeshBuild
);

##### Parameters

lpD3DRMMeshBuild
  Address of the Direct3DRMMeshBuilder object whose contents are being added.

##### Return Values

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

##### Remarks

The source Direct3DRMMeshBuilder object is not modified or referenced by this operation.

###

IDirect3DRMMeshBuilder2::AddNormal

IDirect3DRMMeshBuilder2

Adds a normal to a Direct3DRMMeshBuilder2 object.

int AddNormal(
D3DVALUE x,
D3DVALUE y,
D3DVALUE z
);

##### Parameters

x, y, and z
  The x-, y-, and z-components of the direction of the new normal.

##### Return Values

Returns the index of the normal.

###

IDirect3DRMMeshBuilder2::AddVertex

IDirect3DRMMeshBuilder2

Adds a vertex to a Direct3DRMMeshBuilder2 object.

int AddVertex(
D3DVALUE x,
D3DVALUE y,
D3DVALUE z
);

##### Parameters

x, y, and z
  The x-, y-, and z-components of the position of the new vertex.

##### Return Values

Returns the index of the vertex.

###

IDirect3DRMMeshBuilder2::CreateFace

IDirect3DRMMeshBuilder2

Creates a new face with no vertices and adds it to a Direct3DRMMeshBuilder2 object.

HRESULT CreateFace(
LPDIRECT3DRMFACE* lplpD3DRMFace
);

##### Parameters

lplpD3DRMFace
  Address of a pointer to an IDirect3DRMFace interface that will be filled with a pointer to the face that was created.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::CreateMesh

IDirect3DRMMeshBuilder2

Creates a new mesh from a Direct3DRMMeshBuilder2 object.

HRESULT CreateMesh(
LPDIRECT3DRMMESH* lplpD3DRMMesh
);

##### Parameters

lplpD3DRMMesh
  Address that will be filled with a pointer to an IDirect3DRMMesh interface.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::GenerateNormals2

IDirect3DRMMeshBuilder2

Processes the Direct3DRMMeshBuilder2 object and generates normals for each vertex in a mesh by averaging the face normals for each face that shares the vertex. New normals are generated if the faces sharing a vertex have an angle between them greater than the crease angle.

HRESULT GenerateNormals2(
D3DVALUE dvCreaseAngle,
DWORD dwFlags
);

##### Parameters

dvCreaseAngle
  The least angle in radians that faces can have between them and have a new normal generated.
dwFlags
  One of the following values.
  D3DRMGENERATENORMALS_PRECOMPACT (dwFlags = 1) — Specifies that the algorithm should attempt to compact mesh vertices before it generates normals. See comments below.
  D3DRMGENERATENORMALS_USECREASEANGLE (dwFlags = 2) — Specifies that the dvCreaseAngle parameter should be used. Otherwise, the crease angle is ignored.

##### Return Values

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

##### Remarks

If you specify the D3DRMGENERATENORMALS_PRECOMPACT flag, the precompact pass searches all the vertices in the mesh and merges any that are the same. This is a good way of compacting a mesh that has been loaded. Some meshes have multiple vertices if they have multiple normals at that vertex. This is not necessary in Direct3D Retained Mode. Specifying this flag is the way to get rid of the multiple vertices.

After compacting, the normals are generated. The edges between faces are examined, and if the angle the faces make at the edge is less than the crease angle, the face normals are averaged to generate the vertex normal. If the angle is greater than the crease angle, a new normal is generated. Note that a new vertex is not generated.

###

IDirect3DRMMeshBuilder2::GetBox

IDirect3DRMMeshBuilder2

Retrieves the bounding box containing a Direct3DRMMeshBuilder2 object. The bounding box gives the minimum and maximum model coordinates in each dimension.

HRESULT GetBox(
D3DRMBOX *lpD3DRMBox
);

##### Parameters

lpD3DRMBox
  Address of a D3DRMBOX structure that will be filled with the bounding box coordinates.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::GetColorSource

IDirect3DRMMeshBuilder2

Retrieves the color source of a Direct3DRMMeshBuilder2 object. The color source can be either a face or a vertex.

D3DRMCOLORSOURCE GetColorSource( );

##### Return Values

Returns a member of the D3DRMCOLORSOURCE enumerated type.

##### See Also

IDirect3DRMMeshBuilder2::SetColorSource

###

IDirect3DRMMeshBuilder2::GetFace

IDirect3DRMMeshBuilder2

Retrieves a single face of a Direct3DRMMeshBuilder2 object.

HRESULT GetFace(
DWORD dwIndex,
LPDIRECT3DRMFACE* lplpD3DRMFace
);

##### Parameters

dwIndex
  The index of the mesh face to be retrieved. The face must already be part of a Direct3DRMMeshBuilder2 object.
lplpD3DRMFace
  Address of a pointer to an IDirect3DRMFace interface that is filled with an address of the face.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::GetFaceCount

IDirect3DRMMeshBuilder2

Retrieves the number of faces in a Direct3DRMMeshBuilder2 object.

int GetFaceCount( );

##### Return Values

Returns the number of faces.

###

IDirect3DRMMeshBuilder2::GetFaces

IDirect3DRMMeshBuilder2

Retrieves the faces of a Direct3DRMMeshBuilder2 object.

HRESULT GetFaces(
LPDIRECT3DRMFACEARRAY* lplpD3DRMFaceArray
);

##### Parameters

lplpD3DRMFaceArray
  Address of a pointer to an IDirect3DRMFaceArray interface that is filled with an address of the faces.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::GetPerspective

IDirect3DRMMeshBuilder2

Determines whether perspective correction is on for a Direct3DRMMeshBuilder2 object.

BOOL GetPerspective( );

##### Return Values

Returns TRUE if perspective correction is on, or FALSE otherwise.

###

IDirect3DRMMeshBuilder2::GetQuality

IDirect3DRMMeshBuilder2

Retrieves the rendering quality of a Direct3DRMMeshBuilder2 object.

D3DRMRENDERQUALITY GetQuality( );

##### Return Values

Returns a member of the D3DRMRENDERQUALITY enumerated type that specifies the rendering quality of the mesh.

##### See Also

IDirect3DRMMeshBuilder2::SetQuality

###

IDirect3DRMMeshBuilder2::GetTextureCoordinates

IDirect3DRMMeshBuilder2

Retrieves the texture coordinates of a specified vertex in a Direct3DRMMeshBuilder2 object.

HRESULT GetTextureCoordinates(
DWORD index,
D3DVALUE *lpU,
D3DVALUE *lpV
);

##### Parameters

index
  Index of the vertex.
lpU and lpV
  Addresses of variables that will be filled with the texture coordinates of the vertex when the method returns.

##### Return Values

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

##### See Also

IDirect3DRMMeshBuilder2::SetTextureCoordinates

###

IDirect3DRMMeshBuilder2::GetVertexColor

IDirect3DRMMeshBuilder2

Retrieves the color of a specified vertex in a Direct3DRMMeshBuilder2 object.

D3DCOLOR GetVertexColor(
DWORD index
);

##### Parameters

index
  Index of the vertex.

##### Return Values

Returns the color.

##### See Also

IDirect3DRMMeshBuilder2::SetVertexColor

###

IDirect3DRMMeshBuilder2::GetVertexCount

IDirect3DRMMeshBuilder2

Retrieves the number of vertices in a Direct3DRMMeshBuilder2 object.

int GetVertexCount( );

##### Return Values

Returns the number of vertices.

###

IDirect3DRMMeshBuilder2::GetVertices

IDirect3DRMMeshBuilder2

Retrieves the vertices, normals, and face data for a Direct3DRMMeshBuilder2 object.

HRESULT GetVertices(
DWORD *vcount,
D3DVECTOR *vertices,
DWORD *ncount,
D3DVECTOR *normals,
DWORD *face_data_size,
DWORD *face_data
);

##### Parameters

vcount
  Address of a variable that will contain the number of vertices.
vertices
  Address of an array of D3DVECTOR structures that will contain the vertices for the Direct3DRMMeshBuilder2 object. If this parameter is NULL, the method returns the number of vertices in the vcount parameter.
ncount
  Address of a variable that will contain the number of normals.
normals
  Address of an array of D3DVECTOR structures that will contain the normals for the Direct3DRMMeshBuilder2 object. If this parameter is NULL, the method returns the number of normals in the ncount parameter.
face_data_size
  Address of a variable that specifies the size of the buffer pointed to by the face_data parameter. The size is given in units of DWORD values. This parameter cannot be NULL.
face_data
  Address of the face data for the Direct3DRMMeshBuilder2 object. This data is in the same format as specified in the IDirect3DRMMeshBuilder2::AddFaces method except that it is null-terminated. If this parameter is NULL, the method returns the required size of the face-data buffer in the face_data_size parameter.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::Load

IDirect3DRMMeshBuilder2

Loads a Direct3DRMMeshBuilder2 object.

HRESULT Load(
LPVOID lpvObjSource,
LPVOID lpvObjID,
D3DRMLOADOPTIONS d3drmLOFlags,
D3DRMLOADTEXTURECALLBACK d3drmLoadTextureProc,
LPVOID lpvArg
);

##### Parameters

lpvObjSource
  Source for the object to be loaded. This source can be a file, resource, memory block, or stream, depending on the source flags specified in the d3drmLOFlags parameter.
lpvObjID
  Object name or position to be loaded. The use of this parameter depends on the identifier flags specified in the d3drmLOFlags parameter. If the D3DRMLOAD_BYPOSITION flag is specified, this parameter is a pointer to a DWORD value that gives the object's order in the file. This parameter can be NULL.
d3drmLOFlags
  Value of the D3DRMLOADOPTIONS type describing the load options.
d3drmLoadTextureProc
  A D3DRMLOADTEXTURECALLBACK callback function used to load any textures used by an object that require special formatting. This parameter can be NULL.
lpvArg
  Address of application-defined data passed to the D3DRMLOADTEXTURECALLBACK callback function.

##### Return Values

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

##### Remarks

By default, this method loads the first mesh from the source specified in the lpvObjSource parameter.

###

IDirect3DRMMeshBuilder2::ReserveSpace

IDirect3DRMMeshBuilder2

Reserves space within a Direct3DRMMeshBuilder2 object for the specified number of vertices, normals, and faces. This allows the system to use memory more efficiently.

HRESULT ReserveSpace(
DWORD vertexCount,
DWORD normalCount,
DWORD faceCount
);

##### Parameters

vertexCount, normalCount, and faceCount
  Number of vertices, normals, and faces to allocate space for.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::Save

IDirect3DRMMeshBuilder2

Saves a Direct3DRMMeshBuilder2 object.

HRESULT Save(
const char * lpFilename,
D3DRMXOFFORMAT d3drmXOFFormat,
D3DRMSAVEOPTIONS d3drmSOContents
);

##### Parameters

lpFilename
  Address specifying the name of the created file. This file must have a .x file name extension.
d3drmXOFFormat
  The D3DRMXOF_TEXT value from the D3DRMXOFFORMAT enumerated type.
d3drmSOContents
  Value of the D3DRMSAVEOPTIONS type describing the save options.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::Scale

IDirect3DRMMeshBuilder2

Scales a Direct3DRMMeshBuilder2 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
);

##### Parameters

sx, sy, and sz
  Scaling factors that are applied along the x-, y-, and z-axes.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::SetColor

IDirect3DRMMeshBuilder2

Sets all the faces of a Direct3DRMMeshBuilder2 object to a given color.

HRESULT SetColor(
D3DCOLOR color
);

##### Parameters

color
  Color of the faces.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::SetColorRGB

IDirect3DRMMeshBuilder2

Sets all the faces of a Direct3DRMMeshBuilder2 object to a given color.

HRESULT SetColorRGB(
D3DVALUE red,
D3DVALUE green,
D3DVALUE blue
);

##### Parameters

red, green, and blue
  Red, green, and blue components of the color.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::SetColorSource

IDirect3DRMMeshBuilder2

Sets the color source of a Direct3DRMMeshBuilder2 object.

HRESULT SetColorSource(
D3DRMCOLORSOURCE source
);

##### Parameters

source
  Member of the D3DRMCOLORSOURCE enumerated type that specifies the new color source to use.

##### Return Values

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

##### See Also

IDirect3DRMMeshBuilder2::GetColorSource

###

IDirect3DRMMeshBuilder2::SetMaterial

IDirect3DRMMeshBuilder2

Sets the material of all the faces of a Direct3DRMMeshBuilder2 object.

HRESULT SetMaterial(
LPDIRECT3DRMMATERIAL lpIDirect3DRMmaterial
);

##### Parameters

lpIDirect3DRMmaterial
  Address of IDirect3DRMMaterial interface for the Direct3DRMMeshBuilder2 object.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::SetNormal

IDirect3DRMMeshBuilder2

Sets the normal vector of a specified vertex in a Direct3DRMMeshBuilder2 object.

HRESULT SetNormal(
DWORD index,
D3DVALUE x,
D3DVALUE y,
D3DVALUE z
);

##### Parameters

index
  Index of the normal to be set.
x, y, and z
  The x-, y-, and z-components of the vector to assign to the specified normal.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::SetPerspective

IDirect3DRMMeshBuilder2

Enables or disables perspective-correct texture-mapping for a Direct3DRMMeshBuilder2 object.

HRESULT SetPerspective(
BOOL perspective
);

##### Parameters

perspective
  Specify TRUE if the mesh should be texture-mapped with perspective correction, or FALSE otherwise.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::SetQuality

IDirect3DRMMeshBuilder2

Sets the rendering quality of a Direct3DRMMeshBuilder2 object.

HRESULT SetQuality(
D3DRMRENDERQUALITY quality
);

##### Parameters

quality
  Member of the D3DRMRENDERQUALITY enumerated type that specifies the new rendering quality to use.

##### Return Values

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

##### Remarks

An object's quality has three components: shade mode (flat or Gouraud; Phong shading is not yet implemented and will default to Gouraud shading), lighting type (on or off), and fill mode (point, wireframe, or solid).

You can set the quality of a device with IDirect3DRMDevice::SetQuality. By default it is D3DRMRENDER_FLAT (flat shading, lights on, and solid fill).

You can set the quality of a Direct3DRMMeshBuilder2 object with the SetQuality method. By default, a Direct3DRMMeshBuilder2 object's quality is D3DRMRENDER_GOURAUD (Gouraud shading, lights on, and solid fill).

Direct3D Retained Mode renders an object at the lowest quality setting based on the device and object's current setting for each individual component. For example, if the object's current quality setting is D3DRMRENDER_GOURAUD, and the device is D3DRMRENDER_FLAT then the object will be rendered with flat shading, solid fill and lights on.

If the object's current quality setting is D3DRMSHADE_GOURAUD|D3DRMLIGHT_OFF|D3DRMFILL_WIREFRAME and the device's quality setting is D3DRMSHADE_FLAT|D3DRMLIGHT_ON|D3DRMFILL_POINT, then the object will be rendered with flat shading, lights off, and point fill mode.

These rules apply to Direct3DRMMeshBuilder objects, Direct3DRMMeshBuilder2 objects, and Direct3DRMProgressiveMesh objects. However, Direct3DRMMesh objects do not follow these rules. Mesh objects ignore the device's quality settings and use the group quality setting (which defaults to D3DRMRENDER_GOURAUD).

##### See Also

IDirect3DRMMeshBuilder2::GetQuality

###

IDirect3DRMMeshBuilder2::SetTexture

IDirect3DRMMeshBuilder2

Sets the texture of all the faces of a Direct3DRMMeshBuilder2 object.

HRESULT SetTexture(
LPDIRECT3DRMTEXTURE lpD3DRMTexture
);

##### Parameters

lpD3DRMTexture
  Address of the required Direct3DRMTexture object.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::SetTextureCoordinates

IDirect3DRMMeshBuilder2

Sets the texture coordinates of a specified vertex in a Direct3DRMMeshBuilder2 object.

HRESULT SetTextureCoordinates(
DWORD index,
D3DVALUE u,
D3DVALUE v
);

##### Parameters

index
  Index of the vertex to be set.
u and v
  Texture coordinates to assign to the specified mesh vertex.

##### Return Values

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

##### See Also

IDirect3DRMMeshBuilder2::GetTextureCoordinates

###

IDirect3DRMMeshBuilder2::SetTextureTopology

IDirect3DRMMeshBuilder2

Sets the texture topology of a Direct3DRMMeshBuilder2 object.

HRESULT SetTextureTopology(
BOOL cylU,
BOOL cylV
);

##### Parameters

cylU and cylV
  Specify TRUE for either or both of these parameters if you want the texture to have a cylindrical topology in the u- and v-dimensions, respectively; otherwise, specify FALSE.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::SetVertex

IDirect3DRMMeshBuilder2

Sets the position of a specified vertex in a Direct3DRMMeshBuilder2 object.

HRESULT SetVertex(
DWORD index,
D3DVALUE x,
D3DVALUE y,
D3DVALUE z
);

##### Parameters

index
  Index of the vertex to be set.
x, y, and z
  The x-, y-, and z-components of the position to assign to the specified vertex.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::SetVertexColor

IDirect3DRMMeshBuilder2

Sets the color of a specified vertex in a Direct3DRMMeshBuilder2 object.

HRESULT SetVertexColor(
DWORD index,
D3DCOLOR color
);

##### Parameters

index
  Index of the vertex to be set.
color
  Color to assign to the specified vertex.

##### Return Values

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

##### See Also

IDirect3DRMMeshBuilder2::GetVertexColor

###

IDirect3DRMMeshBuilder2::SetVertexColorRGB

IDirect3DRMMeshBuilder2

Sets the color of a specified vertex in a Direct3DRMMeshBuilder2 object.

HRESULT SetVertexColorRGB(
DWORD index,
D3DVALUE red,
D3DVALUE green,
D3DVALUE blue
);

##### Parameters

index
  Index of the vertex to be set.
red, green, and blue
  Red, green, and blue components of the color to assign to the specified vertex.

##### Return Values

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

###

IDirect3DRMMeshBuilder2::Translate

IDirect3DRMMeshBuilder2

Adds the specified offsets to the vertex positions of a Direct3DRMMeshBuilder2 object.

HRESULT Translate(
D3DVALUE tx,
D3DVALUE ty,
D3DVALUE tz
);

##### Parameters

tx, ty, and tz
  Offsets that are added to the x-, y-, and z-coordinates, respectively, of each vertex position.

##### Return Values

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.