H3D::IndexedFaceSet Class Reference
[X3D node classes.]

The IndexedFaceSet node represents a 3D shape formed by constructing faces (polygons) from vertices listed in the coord field. More...

#include <IndexedFaceSet.h>

Inheritance diagram for H3D::IndexedFaceSet:

Inheritance graph
List of all members.

Public Types

typedef CoordBoundField SFBound
 The bound field for IndexedFaceSet is a CoordBoundField.

Public Member Functions

 H3D_VALUE_EXCEPTION (int, InvalidTexCoordIndex)
 H3D_VALUE_EXCEPTION (int, InvalidNormalIndex)
 H3D_VALUE_EXCEPTION (int, InvalidColorIndex)
 IndexedFaceSet (Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< DisplayList > _displayList=0, Inst< SFColorNode > _color=0, Inst< SFCoordinateNode > _coord=0, Inst< SFNormalNode > _normal=0, Inst< SFTextureCoordinateNode > _texCoord=0, Inst< SFBool > _ccw=0, Inst< SFBool > _colorPerVertex=0, Inst< SFBool > _normalPerVertex=0, Inst< SFBool > _solid=0, Inst< MFVertexAttributeNode > _attrib=0, Inst< AutoNormal > _autoNormal=0, Inst< SFBool > _convex=0, Inst< SFFloat > _creaseAngle=0, Inst< MFInt32 > _set_colorIndex=0, Inst< MFInt32 > _set_coordIndex=0, Inst< MFInt32 > _set_normalIndex=0, Inst< MFInt32 > _set_texCoordIndex=0, Inst< MFInt32 > _colorIndex=0, Inst< MFInt32 > _coordIndex=0, Inst< MFInt32 > _normalIndex=0, Inst< MFInt32 > _texCoordIndex=0)
 Constructor.
virtual X3DCoordinateNodegetCoord ()
virtual void render ()
 Renders the IndexedFaceSet using GL_POLYGONs.

Public Attributes

auto_ptr< MFInt32set_colorIndex
 Field for setting the value of the colorIndex field.
auto_ptr< MFInt32set_coordIndex
 Field for setting the value of the coordIndex field.
auto_ptr< MFInt32set_normalIndex
 Field for setting the value of the normalIndex field.
auto_ptr< MFInt32set_texCoordIndex
 Field for setting the value of the texCoordIndex field.
auto_ptr< MFInt32colorIndex
 Indices into the color field.
auto_ptr< SFBoolconvex
 The convex field indicates whether all polygons in the shape are convex.
auto_ptr< MFInt32coordIndex
 Indices into the coord field.
auto_ptr< SFFloatcreaseAngle
 The creaseAngle field affects how default normals are generated.
auto_ptr< MFInt32normalIndex
 Indices into the normal field.
auto_ptr< MFInt32texCoordIndex
 Indices into the texCoord field.
auto_ptr< AutoNormalautoNormal
 Auto-generated normals that are used if the normal field is NULL.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.

Classes

class  AutoNormal
 Specialized field for automatically generating normals from coordinates. More...

Detailed Description

The IndexedFaceSet node represents a 3D shape formed by constructing faces (polygons) from vertices listed in the coord field.

The coord field contains a Coordinate node that defines the 3D vertices referenced by the coordIndex field. IndexedFaceSet uses the indices in its coordIndex field to specify the polygonal faces by indexing into the coordinates in the Coordinate node. An index of "-1" indicates that the current face has ended and the next one begins. The last face may be (but does not have to be) followed by a "-1" index. If the greatest index in the coordIndex field is N, the Coordinate node shall contain N+1 coordinates (indexed as 0 to N). Each face of the IndexedFaceSet shall have:

Otherwise, The results are undefined.

The IndexedFaceSet node is specified in the local coordinate system and is affected by the transformations of its ancestors. Descriptions of the coord, normal, and texCoord fields are provided in the Coordinate, Normal, and TextureCoordinate nodes, respectively. Details on lighting equations and the interaction between color field, normal field, textures, materials, and geometries are provided in 11 Rendering component and 12 Shape component.

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

If the color field is NULL, the geometry shall be rendered normally using the Material and texture defined in the Appearance node.

If the normal field is not NULL, it shall 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 colours to vertices/faces (where normalPerVertex corresponds to colorPerVertex and normalIndex corresponds to colorIndex). If the normal field is NULL, the browser shall automatically generate normals, using creaseAngle to determine if and how normals are smoothed across shared vertices (see Section 11.2.3 in the X3D specification).

If the texCoord field is not NULL, it shall 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 local coordinate system 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, ties shall 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 and the R coordinate ranges between 0 and the ratio of the smallest dimension of the bounding box to the greatest dimension.

Internal routes:
IndexedFaceSet.dot


Member Data Documentation

auto_ptr< AutoNormal > H3D::IndexedFaceSet::autoNormal
 

Auto-generated normals that are used if the normal field is NULL.

Only accessable in C++.

IndexedFaceSet_autoNormal.dot

auto_ptr< MFInt32 > H3D::IndexedFaceSet::colorIndex
 

Indices into the color field.

See Detailed description for details on how it is used.

Access type: inputOutput
Value range: [0,inf) or -1

IndexedFaceSet_colorIndex.dot

auto_ptr< SFBool > H3D::IndexedFaceSet::convex
 

The convex field indicates whether all polygons in the shape are convex.

A polygon is convex if it is planar, does not intersect itself, and all of the interior angles at its vertices are less than 180 degrees. Non planar and self intersecting polygons may produce undefined results even if the convex field is FALSE.

Access type: inputOutput
Default value: TRUE

IndexedFaceSet_convex.dot

auto_ptr< MFInt32 > H3D::IndexedFaceSet::coordIndex
 

Indices into the coord field.

See Detailed description for details on how it is used.

Access type: inputOutput
Value range: [0,inf) or -1

IndexedFaceSet_coordIndex.dot

auto_ptr< SFFloat > H3D::IndexedFaceSet::creaseAngle
 

The creaseAngle field affects how default normals are generated.

If the angle between the geometric normals of two adjacent faces is less than the crease angle, normals shall be calculated so that the faces are shaded smoothly across the edge; otherwise, normals shall be calculated so that a lighting discontinuity across the edge is produced.

Access type: inputOutput
Default value: 0
Valid range: [0-inf]

IndexedFaceSet_creaseAngle.dot

auto_ptr< MFInt32 > H3D::IndexedFaceSet::normalIndex
 

Indices into the normal field.

See Detailed description for details on how it is used.

Access type: inputOutput
Value range: [0,inf) or -1

IndexedFaceSet_normalIndex.dot

auto_ptr< MFInt32 > H3D::IndexedFaceSet::set_colorIndex
 

Field for setting the value of the colorIndex field.

Access type: inputOnly

IndexedFaceSet_set_colorIndex.dot

auto_ptr< MFInt32 > H3D::IndexedFaceSet::set_coordIndex
 

Field for setting the value of the coordIndex field.

Access type: inputOnly

IndexedFaceSet_set_coordIndex.dot

auto_ptr< MFInt32 > H3D::IndexedFaceSet::set_normalIndex
 

Field for setting the value of the normalIndex field.

Access type: inputOnly

IndexedFaceSet_set_normalIndex.dot

auto_ptr< MFInt32 > H3D::IndexedFaceSet::set_texCoordIndex
 

Field for setting the value of the texCoordIndex field.

Access type: inputOnly

IndexedFaceSet_set_texCoordIndex.dot

auto_ptr< MFInt32 > H3D::IndexedFaceSet::texCoordIndex
 

Indices into the texCoord field.

See Detailed description for details on how it is used.

Access type: inputOutput
Value range: [0,inf) or -1

IndexedFaceSet_texCoordIndex.dot


Generated on Thu Aug 24 12:39:30 2006 for H3D API by  doxygen 1.4.5