Class dnx.lr.node.IndexedFaceSetNode
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.lr.node.IndexedFaceSetNode

java.lang.Object
   |
   +----dnx.util.DNXObject
           |
           +----dnx.lr.Node
                   |
                   +----dnx.lr.SubsidiaryNode
                           |
                           +----dnx.lr.GeometryNode
                                   |
                                   +----dnx.lr.node.IndexedFaceSetNode

public class IndexedFaceSetNode
extends GeometryNode
 IndexedFaceSet {
    eventIn      MFInt32      set_colorIndex  
    eventIn      MFInt32      set_coordIndex  
    eventIn      MFInt32      set_normalIndex 
    eventIn      MFInt32      set_texCoordIndex 
    exposedField SFNode       color           NULL
    exposedField SFNode       coord           NULL
    exposedField SFNode       normal          NULL
    exposedField SFNode       texCoord        NULL
    field        SFBool       ccw             TRUE
    field        MFInt32      colorIndex      []
    field        SFBool       colorPerVertex  TRUE
    field        SFBool       convex          TRUE
    field        MFInt32      coordIndex      []
    field        SFFloat      creaseAngle     0
    field        MFInt32      normalIndex     []
    field        SFBool       normalPerVertex TRUE
    field        SFBool       solid           TRUE
    field        MFInt32      texCoordIndex   []
 }

The IndexedFaceSet node represents a 3D shape formed by constructing faces (polygons) from vertices listed in the coord field. The coord field must contain a Coordinate node. IndexedFaceSet uses the indices in its coordIndex field to specify the polygonal faces. An index of -1 indicates that the current face has ended and the next one begins. The last face may (but does not have to be) followed by a -1. If the greatest index in the coordIndex field is N, then the Coordinate node must contain N+1 coordinates (indexed as 0-N). IndexedFaceSet is specified in the local coordinate system and is affected by parent transformations.

For descriptions of the coord, normal, and texCoord fields, see the Coordinate, Normal, and TextureCoordinate nodes.

See "Concepts - Lighting Model" for details on lighting equations and the interaction between textures, materials, and geometries.

If the color field is not NULL then it must contain a Color node, whose colors are applied to the vertices or faces of the IndexedFaceSet as follows:

If the normal field is NULL, then the browser should automatically generate normals, using creaseAngle to determine if and how normals are smoothed across shared vertices.

If the normal field is not NULL, then it must contain a Normal node, whose normals are applied to the vertices or faces of the IndexedFaceSet in a manner exactly equivalent to that described above for applying colors to vertices/faces.

If the texCoord field is not NULL, then it must contain a TextureCoordinate node. The texture coordinates in that node are applied to the vertices of the IndexedFaceSet as follows:

If the texCoord field is NULL, a default texture coordinate mapping is calculated using the bounding box of the shape. The longest dimension of the bounding box defines the S coordinates, and the next longest defines the T coordinates. If two or all three dimensions of the bounding box are equal, then ties should be broken by choosing the X, Y, or Z dimension in that order of preference. The value of the S coordinate ranges from 0 to 1, from one end of the bounding box to the other. The T coordinate ranges between 0 and the ratio of the second greatest dimension of the bounding box to the greatest dimension. See the figure below for an illustration of default texture coordinates for a simple box shaped IndexedFaceSet with a bounding box with X dimension twice as large as the Z dimension which is twice as large as the Y dimension:

See the introductory "Concepts - Geometry" section for a description of the ccw, solid, convex, and creaseAngle fields.


Variable Index

 o ccw
 o color
 o colorIndex
 o colorPerVertex
 o convex
 o coord
 o coordIndex
 o creaseAngle
 o normal
 o normalIndex
 o normalPerVertex
 o solid
 o texCoord
 o texCoordIndex

Constructor Index

 o IndexedFaceSetNode()

Method Index

 o boundingBoxHasChanged(Field)
Meant to be overridden by subclasses.
 o createNodeDefinition(NodeDefinition)
Create the node definition.
 o handleEvent(SceneEvent)
Handle an event.
 o initFields()
Initialize field values.
 o potentialChildCarryingFieldChange(Field, Node)
 o recomputeBoundingBox(BoundingBox3)
Meant to be overridden by subclasses; compute the bounding box and store into the argument.
 o render(NodeInstance, RenderTraversal)
 o sendModelData(Model)

Variables

 o color
  public SFNode color
 o coord
  public SFNode coord
 o normal
  public SFNode normal
 o texCoord
  public SFNode texCoord
 o ccw
  public SFBool ccw
 o colorIndex
  public MFInt32 colorIndex
 o colorPerVertex
  public SFBool colorPerVertex
 o convex
  public SFBool convex
 o coordIndex
  public MFInt32 coordIndex
 o creaseAngle
  public SFFloat creaseAngle
 o normalIndex
  public MFInt32 normalIndex
 o normalPerVertex
  public SFBool normalPerVertex
 o solid
  public SFBool solid
 o texCoordIndex
  public MFInt32 texCoordIndex

Constructors

 o IndexedFaceSetNode
  public IndexedFaceSetNode()

Methods

 o createNodeDefinition
  protected void createNodeDefinition(NodeDefinition def)
Create the node definition.
Overrides:
createNodeDefinition in class Node
 o initFields
  protected void initFields()
Initialize field values.
Overrides:
initFields in class Node
 o render
  public void render(NodeInstance inst,
                     RenderTraversal traversal)
Overrides:
render in class GeometryNode
 o sendModelData
  public int sendModelData(Model model)
Overrides:
sendModelData in class GeometryNode
 o recomputeBoundingBox
  public void recomputeBoundingBox(BoundingBox3 box)
Meant to be overridden by subclasses; compute the bounding box and store into the argument.
Overrides:
recomputeBoundingBox in class Node
 o boundingBoxHasChanged
  protected boolean boundingBoxHasChanged(Field f)
Meant to be overridden by subclasses.
Overrides:
boundingBoxHasChanged in class Node
 o handleEvent
  protected void handleEvent(SceneEvent ev)
Handle an event.
Overrides:
handleEvent in class Node
 o potentialChildCarryingFieldChange
  public void potentialChildCarryingFieldChange(Field f,
                                                Node newValue)
Overrides:
potentialChildCarryingFieldChange in class Node

All Packages  Class Hierarchy  This Package  Previous  Next  Index