| Package com.ms.com.directX |
Previous |
Microsoft Packages |
Index |
Next |
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:
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.
public void AddVertex(float x, float y, float z);Adds a vertex to a d3drmFace object.
Return Value:
No return value.
Parameter Description x, y, and z The x-, y-, and z-coordinates of the new vertex.
public void AddVertexAndNormalIndexed(int vertex, int normal);Adds a vertex and a normal vector to a d3drmFace object, using an index for the vertex and an index for the normal vector in the containing mesh builder. The face, vertex, and normal must already be part of a d3drmMeshBuilder object.
Return Value:
No return value.
Parameter Description vertex and normal Indexes of the vertex and normal vector to add to the object.
public int GetColor();Retrieves the color of a d3drmFace object.
Return Value:
Returns the color.
See Also: SetColor
public d3drmMaterial GetMaterial();Retrieves the material of a d3drmFace object.
Return Value:
Returns the d3drmMaterial object if successful, or null otherwise.
See Also: SetMaterial
public void GetNormal(d3dvector val);Retrieves the normal vector of a d3drmFace object.
Return Value:
No return value.
Parameter Description val d3dvector object that receives the normal vector of the face.
public d3drmTexture GetTexture();Retrieves the d3drmTexture object applied to a d3drmFace object.
Return Value:
Returns the d3drmTexture object if successful, or null otherwise.
See Also: SetTexture
public int GetTextureCoordinateIndex(int which);Retrieves the index of the vertex for texture coordinates in the face's mesh.
Return Value:
Returns the index.
Parameter Description which 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 d3drmFace object.
Return Value:
No return value.
Parameter Description vertex Index of the vertex. u and v Array variables to receive the texture coordinates of the vertex.
public void GetTextureTopology(int[] u, int[] v);Retrieves the texture topology of a d3drmFace object.
Return Value:
No return value.
Parameter Description 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
public void GetVertex(int idx, d3dvector vert, d3dvector norm);Retrieves the position and normal vector of a vertex in a Direct3DRMFace object.
Return Value:
No return value.
Parameter Description idx Index of the vertex. vert and norm The d3dvector objects that receive the position and normal vector of the vertex, respectively.
public int GetVertexCount();Retrieves the number of vertices in a d3drmFace object.
Return Value:
Returns the number of vertices.
public int GetVertexIndex(int which);Retrieves the index of the vertex in the face's mesh.
Return Value:
Returns the index.
Parameter Description which Index within the face of the vertex.
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.
Parameter Description 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.
public void GetVerticesSize(int[] v_cnt);Retrieves the number of vertices associated with a d3drmFace object.
Return Value:
No return value.
Parameter Description v_cnt Array variable to receive the number of vertices. See Also: GetVertices
public void SetColor(int c);Sets a d3drmFace object to a given color.
Return Value:
No return value.
Parameter Description c Color to set for the object. See Also: GetColor
public void SetColorRGB(float r, float g, float b);Sets a d3drmFace object to a given color.
Return Value:
No return value.
Parameter Description r, g, and b Red, green, and blue components, respectively, of the color to set for the object.
public void SetMaterial(d3drmMaterial ref);Sets the material of a d3drmFace object.
Return Value:
No return value.
Parameter Description ref d3drmMaterial object to set. See Also: GetMaterial
public void SetTexture(d3drmTexture ref);Sets the texture of a d3drmFace object.
Return Value:
No return value.
Parameter Description ref d3drmTexture object to set. See Also: GetTexture
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.
Parameter Description vertex Index of the vertex to be set. For example, if the face were a triangle, the possible vertex indexes would be 0, 1, and 2. u and v Texture coordinates to assign to the specified vertex.
public void SetTextureTopology(int wrap_u, int wrap_v);Sets the texture topology of a d3drmFace object.
Return Value:
No return value.
Parameter Description wrap_u and wrap_v Specify whether the texture has a cylindrical topology in the u- and v-dimensions. See Also: GetTextureTopology
| © 1997 Microsoft Corporation. All rights reserved. Terms of Use. |