## X3D Example Archives: Conformance Nist, Geometry, Indexed Face Set

 IndexedFaceSet defines polygons using index lists corresponding to vertex coordinates. IndexedFaceSet is a geometry node containing a Coordinate|CoordinateDouble node, and can also contain Color|ColorRGBA, Normal and TextureCoordinate nodes. Wikipedia: see Polygon. X3D Tooltips of interest: IndexedFaceSet. X3D Specification sections of interest: 13 Geometry3D component, 13.2 Concepts and 13.3.6 IndexedFaceSet. X3D Examples Archives of related interest: VRML 2 Sourcebook:  Chapter 13 Points Lines Faces X3D for Web Authors: Chapter 06 Geometry Points Lines Polygons
21 X3D Scenes       Scene Descriptions
color Index color Test of colorPerVertex field is set to true and the colorIndex is set valid indices for the Color node. Under these conditions the colors are applied to each face in the order given by the colorIndex Vertices are connected in a counter-clockwise direction. Faces are drawn and colored from left to right starting with the front face. The test should generate a solid multicolor cube with the right face colored Red and the left face colored Green. The rest of the faces should be colored as a transition of the Green and Red colors. (Green transitioning to Red).
convex FALSE This test sets the convex field to false for a figure that is not convex The solid field is set to false.
convex TRUE This test sets the convex field to true for a figure that is not convex The solid field is set to false.
coord Index color Test of colorPerVertex field is set to true and the colorIndex field is set to empty. Under these conditions the colors are applied to each face in the order given by the coordIndex. Faces are drawn from left to right starting with the front figure. The colors (in used order) are Red and Green. The test should generate a solid cube. The left (front and back) vertices of the cube are colored Red and the right (front and back) vertices are colored Green. The right face should be Green and the left face should be Red. The rest of the faces should be a transition of Red to Green.
coordindex normal Test of normalPerVertex field is set to true and the normalIndex field is set to empty. Under these conditions the normals are applied to each vertex in the order given by the coordIndex field. A +Z normal is defined for the upper front vertices, a +Y normal is defined for all the bottom vertices, a +X normal is defined for the back right (uppermost) vertex and a -X normal is defined for the back left (uppermost) vertex. The test should generate a figure with the upper vertices illuminated the most. The top, back and bottom sides should be dark when facing the headlight directly from the front.
default creaseangle This test uses the default value for the creaseAngle field for an IndexedFaceSet (Sphere). This value (0.0) will result in rendering a faceted figure along adjacent faces.
default faceset This world tests browser ability to draw an IndexedFace set using mostly default values.
default texturecoord Test of texCoord field is set to NULL and a texture image is defined using an appearance node. Since there is no texCoord field, the browser should calculate a default texture coordinate mapping using the bounding box of the shape.
empty color Index Test of colorPerVertex field is set to false and the colorIndex field is set to empty. Under such conditions the colors are applied to each face in the order given by the Color node. Faces are colored from left to right starting with the front face. The colors (in used order) are Red, Green, Blue and Yellow.
empty normal Index Test of normal field set not NULL, the normalPerVertex field is set to F ALSE and the normalIndex field is set to empty. Under these conditions the normals are applied to each face in the same order given by the normal field. Normals for the front, left and right faces are defined with the same orientation as the face, therefore these faces should be visible as the figure is rotated. Normals for the top, bottom and back faces are defined to point towards the inside of the cube, therefore these faces should not be visible at any time.
empty texture Index Test of textCoord field set to valid values (and not NULL), the texCoordIndex field is set empty. Under these conditions the image texture is apply to the vertices in the IndexedFaceSet in the order given by the CoordIndex field.
faces 5000 Test browser support of 5000 faces per IndexedFaceSet. A sine wave function graph is used to draw 5000 faces for a single IndexedFaceSet as required by section 7.3 of the VRML specifications.
filled color Index Test of colorPerVertex field set to false and the colorIndex field is set to valid indices for each color in the Color node. Under these conditions the colors are applied to each face in the order given by the colorIndex field. Faces are drawn and colored from left to right starting with the front face. (Colors in used order are Blue, Yellow, Green, Red, Green and Red)
filled normal Index Test of normal field set to not NULL, the normalPerVertex ifield is set to false and the normalIndex field is set to not empty. Under these circumstances the normals are applied to each face in the order given by the normalIndex field. Normals for the front, back and bottom faces are defined with the same orientation as the face, therefore these faces should be visible as the figure is rotated. Normals for the top, left and right faces are defined to point towards the inside of the cube, therefore these faces should not be visible at any time.
filled texture Index Tese of textCoord field set to valid values (and not NULL), the texCoordIndex field is set to valid values for the texCoord field. Under these conditions the image texture is apply to the vertices in the IndexedFaceSet in the order given by the texCoordIndex field.
normalindex normal Test of normalPerVertex field set to true and the normalIndex field is set to valid indices for the normal field. Under these conditions the normals are applied to each vertex in the order given by the normalIndex field. A -Y normal is defined for all the top vertices, a +Z normal is defined for the lower front vertices, a +X normal is defined for the back right (lowermost) vertex and a -X normal is defined for the back left (lowermost) vertex. The test should generate a solid cube with the lower vertices illuminated the most. The back, top and bottom sides should be dark when facing the headlight directly from the front.
nosolidshape This test sets the solid field to false, therefore preventing the browser from doing backface culling. The tester should be able to see the backface of all faces. Each face is painted using a different color.
reversefaces ccw FALSE Test of ccw field set to false and the faces are drawn in a clockwise direction. No texture mapping or color fields are set. The test should generate a non-solid cube with a Green diffuseColor.
set creaseangle This tests redefines the value for the creaseAngle for an IndexedFaceSet (sphere). This value (1.5) will result in rendering a smoother figure along adjacent faces.
setmax creaseangle This tests redefines the value for the creaseAngle for an IndexedFaceSet (sphere) to the maximum possibe value. This value (6.27) will result in rendering a really smooth figure along adjacent faces.
vertices 10 A square figure is used to draw 10 vertices for a single face of an IndexedFaceSet as required by section 7.3 of the VRML specifications.
 Master source-code model archive is under subversion control at http://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/ConformanceNist/Geometry/IndexedFaceSet

The X3D Resources: Examples page and Savage Developers Guide provide more information about the production of this archive.