Package com.ms.com.directX Previous
Previous
Microsoft Packages
Microsoft Packages
Index
Index
Next
Next

Class d3drmFace

Applications use the methods of the d3drmFace class to interact with a single polygon in a mesh.

public class d3drmFace implements Id3drmFace
{
  public void InternalSetObject(IUnknown lpdd);
  public IUnknown InternalGetObject();
  public void AddDestroyCallback(Id3drmCallback fn, IUnknown Arg);
  public void DeleteDestroyCallback(Id3drmCallback fn, IUnknown args);
  public d3drmFace Clone();
  public void SetAppData(int data);
  public int GetAppData();
  public void SetName(String name);
  public String GetName();
  public String GetClassName();
  public void AddVertex(float x, float y, float z);
  public void AddVertexAndNormalIndexed(int vertex, int normal);
  public void SetColorRGB(float r, float g, float b);
  public void SetColor(int c);
  public void SetTexture(d3drmTexture ref);
  public void SetTextureCoordinates(int vertex, float u, float v);
  public void SetMaterial(d3drmMaterial ref);
  public void SetTextureTopology(int wrap_u, int wrap_v);
  public void GetVertex(int idx, d3dvector vert, d3dvector norm);
  public void GetVerticesSize(int[] v_cnt);
  public void GetVertices(int[] vertex_cnt, d3dvector coord, d3dvector normals);
  public void GetTextureCoordinates(int vertex, float[] u, float[] v);
  public void GetTextureTopology(int[] u, int[] v);
  public void GetNormal(d3dvector val);
  public d3drmTexture GetTexture();
  public d3drmMaterial GetMaterial();
  public int GetVertexCount();
  public int GetVertexIndex(int which);
  public int GetTextureCoordinateIndex(int which);
  public int GetColor();
}

The methods can be organized into the following groups:
Color GetColor
SetColor
SetColorRGB
Materials GetMaterial
SetMaterial
Textures GetTexture
GetTextureCoordinateIndex
GetTextureCoordinates
GetTextureTopology
SetTexture
SetTextureCoordinates
SetTextureTopology
Vertices and normals AddVertex
AddVertexAndNormalIndexed
GetNormal
GetVertex
GetVertexCount
GetVertexIndex
GetVertices
GetVerticesSize

In addition, the d3drmFace class inherits the following methods from the d3drmObject class:
AddDestroyCallback
Clone
DeleteDestroyCallback
GetAppData
GetClassName
GetName
SetAppData
SetName

The d3drmFace object is obtained by calling the CreateFace method.

AddVertex

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

Adds a vertex to a d3drmFace object.

Return Value:

No return value.

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


AddVertexAndNormalIndexed

public void AddVertexAndNormalIndexed(int vertex, int normal);

Adds a vertex and a normal to a d3drmFace 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 d3drmMeshBuilder object.

Return Value:

No return value.

ParameterDescription
vertex and normal Indexes of the vertex and normal to add.


GetColor

public int GetColor();

Retrieves the color of a d3drmFace object.

Return Value:

Returns the color.

See Also: SetColor


GetMaterial

public d3drmMaterial GetMaterial();

Retrieves the material of a d3drmFace object.

Return Value:

Returns the d3drmMaterial object if successful; null otherwise.

See Also: SetMaterial


GetNormal

public void GetNormal(d3dvector val);

Retrieves the normal vector of a d3drmFace object.

Return Value:

No return value.

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


GetTexture

public d3drmTexture GetTexture();

Retrieves the d3drmTexture object applied to a d3drmFace object.

Return Value:

Returns the d3drmTexture object if successful; null otherwise.

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 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 d3drmFace object.

Return Value:

No return value.

ParameterDescription
vertex Index of the vertex.
u and v Array variables that receive the texture coordinates of the vertex.


GetTextureTopology

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

Retrieves the texture topology of a d3drmFace object.

Return Value:

No return value.

ParameterDescription
u and v 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 Index of the vertex.
vert and norm The d3dvector objects that receive the position and normal of the vertex, respectively.


GetVertexCount

public int GetVertexCount();

Retrieves the number of vertices in a d3drmFace 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 Index within the face of the vertex.


GetVertices

public void GetVertices(int[] vertex_cnt, d3dvector coord, d3dvector normals);

Retrieves the position and normal vector of each vertex in a d3drmFace object.

Return Value:

No return value.

ParameterDescription
vertex_cnt Array variable that receives the number of vertices.
coord and normals The d3dvector objects that receive the positions and normal vectors of the vertices, respectively.


SetColor

public void SetColor(int c);

Sets a d3drmFace object to a given color.

Return Value:

No return value.

ParameterDescription
c Color to set.

See Also: GetColor


SetColorRGB

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

Sets a d3drmFace object to a given color.

Return Value:

No return value.

ParameterDescription
r, g, and b The red, green, and blue components of the color.


SetMaterial

public void SetMaterial(d3drmMaterial ref);

Sets the material of a d3drmFace object.

Return Value:

No return value.

ParameterDescription
ref The d3drmMaterial object to set.

See Also: GetMaterial


SetTexture

public void SetTexture(d3drmTexture ref);

Sets the texture of a d3drmFace object.

Return Value:

No return value.

ParameterDescription
ref The d3drmTexture 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 d3drmFace 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 and v Texture coordinates to assign to the specified vertex.


SetTextureTopology

public void SetTextureTopology(int wrap_u, int wrap_v);

Sets the texture topology of a d3drmFace object.

Return Value:

No return value.

ParameterDescription
wrap_u and wrap_v Specify whether the texture has a cylindrical topology in the u and v dimensions.

See Also: GetTextureTopology


GetVerticesSize

public void GetVerticesSize(int[] v_cnt);

Retrieves the number of vertices associated with a d3drmFace object.

Return Value:

No return value.

ParameterDescription
v_cnt Array variable that receives the number of vertices.

See Also: GetVertices



Top© 1996 Microsoft Corporation. All rights reserved.