Nodes Home Page   Node Directory   Node Hierarchy

Shout3D Nodes Reference


IndexedFaceSet


Introduction

The IndexedFaceSet node is the classic VRML representation of solid mesh geometry. An IndexedFaceSet node is most likely to be created by VRML export from a modeling program for which direct .s3d export is unavailable. The IndexedFaceSet lacks important advantages of the MultiMesh node, namely the ability to support multiple materials and textures assigned to different regions of the mesh and flexible smoothing groups.

IndexedFaceSet assumes that all polygons will be convex. If the polygons are concave, non-planar, or self-intersecting, the results of rendering (and picking) are undefined.

Link to Javadocs.


Fields

creaseAngle

FloatField creaseAngle

USAGE = NON_NEGATIVE_FLOAT
DEFAULT = 0

A single angular value (specified in radians, not degrees), applied to the entire mesh that determines whether polygons are rendered smooth shaded or flat-shaded. If the angle formed by the normal vectors of two polygons meeting at an edge is less than the creaseAngle, the polygons will be rendered smooth shaded across that edge. If the angle is equal to or greater than the creaseAngle, they will be rendered with a lighting discontinuity accross that edge.

For example, if a perfect cube-shaped IndexedFaceSet (all edges being 90 -degree angles) uses a creaseAngle of 1.5708 radians - slightly more than 90 degrees - it will be rendered smoothed shaded over all edges. If the value is decreased to 1.5707 radians - slightly less than 90 degrees, the mesh renders flat shaded over all edges, and therefore preserves a properly "faceted" look.

A value of 3.14 radians (almost 180 degrees) assures that the entire IndexedFaceSet will be rendered smooth shaded. A value of 0 radians (0 degrees) assures that the entire IndexedFaceSet will be rendered flat shaded. Note: (3.1416) radians = 180 degrees.


solid

BooleanField solid

USAGE = ANY
DEFAULT = true

Determines whether both sides, or only one side, of each polygon are displayed. If true, backface culling is perfomed and only the front side of each polygon is rendered. If false, both sides of each polygon are rendered. The name "solid" reflects the fact that there will be no need to perform rendering computations on back-facing polygons inside a solid object.

See Notes below for technical information concerning the determination of back faces.


texCoord

NodeField texCoord

USAGE = TEXTURE_COORDINATE_NODE
DEFAULT = null

A TextureCoordinate node with a list of 2D texture coordinate to be applied to the vertices of the IndexedFaceSet.

If this field is null, no texture will be applied even if there is a texture specified in the associated Appearance node.


texCoordIndex

IntArrayField texCoordIndex

USAGE = INDEX_ARRAY
DEFAULT = {}

Used, optionally, to assign the texture coordinates in the texCoord field specific vertices for each polygon.

If the field is null or empty, texture coordinates are assigned to vertices using the indices in the coordIndex directly. For example, assume that the coordIndex array begins [2 0 1 -1, ...] The first vertex for the first polygon will be assigned the third pair of texture cooridnates in the texCoord array, the second vertex in the first polygon will be assigned the first pair of texture coordinates, and the third vertex in the first polygon will be assigned the second pair of texture coordinates.

If the field is not null or empty, the order of vertices in the coordIndex field is still used, but the texture cooridnate pairs to be assigned are determined by the values in the texCoorIndex field. For example, a texCoordIndex array beginning [2 0 3 -1, ...] indicates that the third texture coordinate pair in the texCoord array is to be applied to the first vertex of first polygon specified in the coordIndex field, the first texture coordinate pair is to be applied to the second vertex of the first polygon, and the fourth texture coordinate pair is to be applied to the third vertex of the first polygon.


ccw

BooleanField ccw

Inherited from Mesh

USAGE = ANY
DEFAULT = true

Determines the direction of the renderable side of the mesh. Changing the value from true to false, or vice versa, "flips the normals" and causes the opposite site of the mesh to render.

More technically, The ccw field defines the ordering of the vertex coordinates of the geometry with respect to the automatically generated normal vectors used in the lighting model equations. If the value is true, the normals follow the right hand rule; the orientation of each normal with respect to the vertices (taken in order) will be such that the vertices appear to be oriented in a counterclockwise order when the vertices are viewed (in the local coordinate system of the Shape) from the opposite direction as the normal. If the value is false, the normals are oriented in the opposite direction.


colorIndex

IntArrayField colorIndex

Inherited from Mesh

USAGE = INDEX_ARRAY
DEFAULT = {}

Used, optionally, to apply the list of colors in the Color node of the color field to specific vertices or faces.

If this field is empty, only the coordIndex field is used for this purpose. In the case of color per polygon (colorPerVertex=false), the colors in Color node are applied to each polygon in the order in which polygons are specified in the coordIndex field. Thus there must be at least as many colors in the Color node as there are polygons in the coordIndex field. In the case of vertex color (colorPerVertex=true), the colors in the Color node are applied to each vertex in each polygon in the order in which vertices are listed in the coordIndex field. Thus there must be at least as many colors in the Color node as there are indices (vertices) in the coordIndex field.

If this field is not empty, the order of polygons or vertices in the coordIndex field is still used, but the specific color to be assigned is determined by the values in the colorIndex. In the case of color per polygon (colorPerVertex=false), each polygon in the coordIndex field is assigned a color using the corresponding index value in the colorIndex array. For example, a colorIndex array beginning [2,0,...] indicates that the third color in the Color node (indexed as 2) is to be applied to the first polygon specified in the coordIndex field, and that the first color in the Color node (indexed as 0) is to be applied to the second polygon specified in the coordIndex field. In the case of vextex color (colorPerVertex=true), each vertex in each polygon the coordIndex field is assigned a color using the corresponding index value in the colorIndex array. For example, a colorIndex array beginning [2 0 3 -1, ...] indicates that the third color in the Color node is to be applied to the first vertex of first polygon specified in the coordIndex field, the first color in the Color node is to be applied to the second vertex of the first polygon, and the fourth color in the Color node is to be applied to the third vertex of the first polygon.


colorPerVertex

BooleanField colorPerVertex

Inherited from Mesh

USAGE = ANY
DEFAULT = true

If true, the values in the color field are applied to vertices ("color per vertex" or "vertex colors"). If false, the values in the color field are applied to polygons ("color per polygon"). Applies only if the value in the color field is not null


coordIndex

IntArrayField coordIndex

Inherited from Mesh

USAGE = INDEX_ARRAY
DEFAULT = {}

Specifies each polygon in the mesh by reference to the vertices in the Coordinate node in the coord field. -1 and -2 are delimiters indicating the end of a polygon. For example, the array {0, 1, 3, -1, 3, 0, 2, -1} specifies two triangular polygons (or polylines). The first one is created by connecting the first, second and fourth vertices listed in the Coordinate array. The second is created by connecting the fourth, first and third vertices listed in the Coordinate array.


color

NodeField color

Inherited from Geometry

USAGE = COLOR_NODE
DEFAULT = null

A Color node containing a list of RBG color values.

If this field is null, the geometry is rendered normally, using the material and texture values in the applicable Appearance node.


coord

NodeField coord

Inherited from Geometry

USAGE = COORDINATE_NODE
DEFAULT = null

Contains a Coordinate node specifying the vertices.


Methods

onFieldChange

void onFieldChange(Field theField, java.lang.Object userData)


Notes


Copyright© 1999-2001, Shout3D LLC.