This node is one of the shape Nodes group. This node provides you with a 3D shape formed by constructing faces, or polygons, from vertices located at the current coordinates.
FILE FORMAT/DEFAULTS IndexedFaceSet coordIndex 0 # MFLong materialIndex -1 # MFLong normalIndex -1 # MFLong textureCoordIndex -1 # MFLong }
This node uses the indices in the coordIndex field to specify the polygonal faces. These indices are derived from IndexedShape. An index of -1 means the current face is finished and the next face is beginning.
The vertices of these polygons, or the faces, are transformed by the current transformation matrix.
Here's how the current material and normal binding are treated. The material or normal for each face are determined by the PER_PART and PER_FACE bindings. The material or normal for each vertex is determined by PER_VERTEX. The corresponding INDEXED bindings are the same, but use the materialIndex or normalIndex indices. You can see the explanation of IndexedShape later for more information on this topic. In regard to default values, the DEFAULT material binding is equal to OVERALL and the DEFAULT normal binding is equal to PER_VERTEX_INDEXED. If there aren't enough normals in the world's state, vertex normals will be created automatically.
You can bind explicit texture coordinates to vertices of an indexed shape either one after another, if the texture coordinate binding is PER_VERTEX, or by using the indices in the textureCoordIndex field, if the binding is PER_VERTEX_INDEXED. Explicit texture coordinates are defined in the discussion of TextureCoordinate2. A default texture coordinate mapping is created using the bounding box of the shape if a current texture is declared but no texture coordinates are specified. The S and T coordinates are created in the following manner. The longest dimension of the bounding box defines the S coordinates. The second longest dimension of the bounding box defines the T coordinates. The S coordinate can be between 0 and 1, ranging the length of the bounding box. The T coordinate can be between 0 and the ratio of the second greatest dimension of the bounding box to the greatest dimension.
You'll need to make sure that the indices listed in the coordIndex, materialIndex, normalIndex, and textureCoordIndex fields are valid in relationship to the current state. If you don't, it is probable that you'll have errors.
Example Use
The following code fragment is from Reliant.wrl.
IndexedFaceSet { coordIndex [1224, 1276, 1364, -1,1120, 1134, 1364, -1,1276, 1361, 1397, -1,1162, 1224, 1276, -1,1162, 1361, 1276, -1,1035, 1162, 1224, -1,951, 1035, 1166, -1,1035, 1166, 1224, -1,1166, 1224, 1364, -1,951, 1134, 1166, -1,1276, 1397, 1364, -1,1134, 1166, 1364, -1,...}
IndexedShape, MFLong, PER_PART, PER_FACE, PER_VERTEX, PER_VERTEX_INDEXED, TextureCoordinate2