Class Direct3dRMFace
public class Direct3dRMFace implements IDirect3dRMFace
{
// Methods
public void addVertex(float x, float y, float z);
public void addVertexAndNormalIndexed(int vertex, int normal);
public int getColor();
public Direct3dRMMaterial getMaterial();
public void getNormal(D3dVector val);
public Direct3dRMTexture getTexture();
public int getTextureCoordinateIndex(int which);
public void getTextureCoordinates(int vertex, float[] u,
float[] v);
public void getTextureTopology(int[] u, int[] v);
public void getVertex(int idx, D3dVector vert, D3dVector norm);
public int getVertexCount();
public int getVertexIndex(int which);
public void getVertices(int vCount, D3dVector[] v, D3dVector[] n);
public void getVerticesAsFloats(int[] vertex_cnt,
D3dVector coord, D3dVector normals);
public void getVerticesSize(int[] v_cnt);
public void setColor(int c);
public void setColorRGB(float r, float g, float b);
public void setMaterial(Direct3dRMMaterial ref);
public void setTexture(Direct3dRMTexture ref);
public void setTextureCoordinates(int vertex, float u, float v);
public void setTextureTopology(int wrap_u, int wrap_v);
}
Applications use the methods of the Direct3dRMFace class to interact with a single polygon in a mesh.
The Direct3dRMFace class inherits the following methods from the Direct3dRMObject class:
- addDestroyCallback
- duplicate
- deleteDestroyCallback
- getAppData
- getClassName
- getName
- setAppData
- setName
The Direct3dRMFace object is obtained by calling the createFace method.
public void addVertex(float x, float y, float z);
Adds a vertex to a Direct3dRMFace object.
Return Value:
No return value.
Parameter | Description |
x
| The x component of the position of the new vertex.
|
y
| The y component of the position of the new vertex.
|
z
| The z component of the position of the new vertex.
|
public void addVertexAndNormalIndexed(int vertex, int normal);
Adds a vertex and a normal to a Direct3dRMFace object by 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.
Return Value:
No return value.
Parameter | Description |
vertex
| Index of the vertex to add.
|
normal
| Index of the normal to add.
|
public int getColor();
Retrieves the color of a Direct3dRMFace object.
Return Value:
Returns the color.
See Also: setColor
public Direct3dRMMaterial getMaterial();
Retrieves the material of a Direct3dRMFace object.
Return Value:
Returns the Direct3dRMMaterial object if successful; otherwise, returns null.
See Also: setMaterial
public void getNormal(D3dVector val);
Retrieves the normal vector of a Direct3dRMFace object.
Return Value:
No return value.
Parameter | Description |
val
| The D3dVector object that receives the normal vector of the face.
|
public Direct3dRMTexture getTexture();
Retrieves the Direct3dRMTexture object applied to a Direct3dRMFace object.
Return Value:
Returns the Direct3dRMTexture object if successful; otherwise, returns null.
See Also: setTexture
public int getTextureCoordinateIndex(int which);
Retrieves the index of the vertex for texture coordinates in the face's mesh. This index corresponds to the index specified in the which parameter.
Return Value:
Returns the index.
Parameter | Description |
which
| The index within the face of the vertex.
|
public void getTextureCoordinates(int vertex, float[] u, float[] v);
Retrieves the texture coordinates of a vertex in a Direct3dRMFace object.
Return Value:
No return value.
Parameter | Description |
vertex
| The index of the vertex.
|
u
| The array variables that receive the texture u coordinates of the vertex.
|
v
| The array variables that receive the texture v coordinates of the vertex.
|
public void getTextureTopology(int[] u, int[] v);
Retrieves the texture topology of a Direct3dRMFace object.
Return Value:
No return value.
Parameter | Description |
u
| The array variables that are set or cleared, depending on how the cylindrical wrapping flags are set for the face.
|
v
| The array variables that are set or cleared, depending on how the cylindrical wrapping flags are set for the face.
|
See Also: setTextureTopology
public void getVertex(int idx, D3dVector vert, D3dVector norm);
Retrieves the position and normal of a vertex in a Direct3dRMFace object.
Return Value:
No return value.
Parameter | Description |
idx
| The index of the vertex.
|
vert
| The D3dVector objects that receive the position of the vertex.
|
norm
| The D3dVector objects that receive the normal of the vertex.
|
public int getVertexCount();
Retrieves the number of vertices in a Direct3dRMFace object.
Return Value:
Returns the number of vertices.
public int getVertexIndex(int which);
Retrieves the index of the vertex in the face's mesh. This index corresponds to the index specified in the which parameter.
Return Value:
Returns the index.
Parameter | Description |
which
| The index within the face of the vertex.
|
public void getVertices(int vCount, D3dVector[] v, D3dVector[] n);
Retrieves the position and normal vector of each vertex in a Direct3dRMFace object.
Return Value:
No return value.
Parameter | Description |
vCount
| The number of vectors.
|
v
| The D3dVector array that receives the vertices.
|
n
| The D3dVector array that receives the normals.
|
public void getVerticesAsFloats(int[] vertex_cnt, D3dVector coord,
D3dVector normals);
Retrieves the position and normal vector of each vertex in a Direct3dRMFace object (as floats).
Return Value:
No return value.
Parameter | Description |
vertex_cnt
| The array variable that receives the number of floats of the vertices.
|
coord
| The D3dVector objects that receive the positions vectors of the vertices.
|
normals
| The D3dVector objects that receive the normal vectors of the vertices.
|
public void getVerticesSize(int[] v_cnt);
Retrieves the number of vertices associated with a Direct3dRMFace object.
Return Value:
No return value.
Parameter | Description |
v_cnt
| The array variable that receives the number of vertices.
|
See Also: getVertices
public void setColor(int c);
Sets a Direct3dRMFace object to a given color.
Return Value:
No return value.
Parameter | Description |
c
| The color to set.
|
See Also: getColor
public void setColorRGB(float r, float g, float b);
Sets a Direct3dRMFace object to a given color.
Return Value:
No return value.
Parameter | Description |
r
| The red component of the color.
|
g
| The green component of the color.
|
b
| The blue component of the color.
|
public void setMaterial(Direct3dRMMaterial ref);
Sets the material of a Direct3dRMFace object.
Return Value:
No return value.
See Also: getMaterial
public void setTexture(Direct3dRMTexture ref);
Sets the texture of a Direct3dRMFace object.
Return Value:
No return value.
See Also: getTexture
public void setTextureCoordinates(int vertex, float u, float v);
Sets the texture coordinates of a specified vertex in a Direct3dRMFace object.
Return Value:
No return value.
Parameter | Description |
vertex
| Index of the vertex to be set. For example, if the face were a triangle, the possible vertex indices would be 0, 1, and 2.
|
u
| The texture u coordinate to assign to the specified vertex.
|
v
| The texture v coordinate to assign to the specified vertex.
|
public void setTextureTopology(int wrap_u, int wrap_v);
Sets the texture topology of a Direct3dRMFace object.
Return Value:
No return value.
Parameter | Description |
wrap_u
| Specifies whether the texture has a cylindrical topology in the u dimension.
|
wrap_v
| Specifies whether the texture has a cylindrical topology in the v dimension.
|
See Also: getTextureTopology