Packages
 In this topic

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.directX   Previous This
Package
Next

 


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.

Methods

addVertex

public void addVertex(float x, float y, float z);

Adds a vertex to a Direct3dRMFace object.

Return Value:

No return value.

ParameterDescription
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.

addVertexAndNormalIndexed

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.

ParameterDescription
vertex Index of the vertex to add.
normal Index of the normal to add.

getColor

public int getColor();

Retrieves the color of a Direct3dRMFace object.

Return Value:

Returns the color.

See Also: setColor

getMaterial

public Direct3dRMMaterial getMaterial();

Retrieves the material of a Direct3dRMFace object.

Return Value:

Returns the Direct3dRMMaterial object if successful; otherwise, returns null.

See Also: setMaterial

getNormal

public void getNormal(D3dVector val);

Retrieves the normal vector of a Direct3dRMFace object.

Return Value:

No return value.

ParameterDescription
val The D3dVector object that receives the normal vector of the face.

getTexture

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

getTextureCoordinateIndex

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.

ParameterDescription
which The index within the face of the vertex.

getTextureCoordinates

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.

ParameterDescription
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.

getTextureTopology

public void getTextureTopology(int[] u, int[] v);

Retrieves the texture topology of a Direct3dRMFace object.

Return Value:

No return value.

ParameterDescription
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

getVertex

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.

ParameterDescription
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.

getVertexCount

public int getVertexCount();

Retrieves the number of vertices in a Direct3dRMFace object.

Return Value:

Returns the number of vertices.

getVertexIndex

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.

ParameterDescription
which The index within the face of the vertex.

getVertices

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.

ParameterDescription
vCount The number of vectors.
v The D3dVector array that receives the vertices.
n The D3dVector array that receives the normals.

getVerticesAsFloats

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.

ParameterDescription
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.

getVerticesSize

public void getVerticesSize(int[] v_cnt);

Retrieves the number of vertices associated with a Direct3dRMFace object.

Return Value:

No return value.

ParameterDescription
v_cnt The array variable that receives the number of vertices.

See Also: getVertices

setColor

public void setColor(int c);

Sets a Direct3dRMFace object to a given color.

Return Value:

No return value.

ParameterDescription
c The color to set.

See Also: getColor

setColorRGB

public void setColorRGB(float r, float g, float b);

Sets a Direct3dRMFace object to a given color.

Return Value:

No return value.

ParameterDescription
r The red component of the color.
g The green component of the color.
b The blue component of the color.

setMaterial

public void setMaterial(Direct3dRMMaterial ref);

Sets the material of a Direct3dRMFace object.

Return Value:

No return value.

ParameterDescription
ref The Direct3dRMMaterial object to set.

See Also: getMaterial

setTexture

public void setTexture(Direct3dRMTexture ref);

Sets the texture of a Direct3dRMFace object.

Return Value:

No return value.

ParameterDescription
ref The Direct3dRMTexture object to set.

See Also: getTexture

setTextureCoordinates

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.

ParameterDescription
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.

setTextureTopology

public void setTextureTopology(int wrap_u, int wrap_v);

Sets the texture topology of a Direct3dRMFace object.

Return Value:

No return value.

ParameterDescription
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

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.