VRML example: Mistake

This example shows that the ordering of the polygon vertices is important.

#VRML V1.0 ascii

Separator {
   Material {
      diffuseColor 1.0 1.0 1.0
      ambientColor 0.1 0.1 0.1
   }
   ShapeHints {
      vertexOrdering CLOCKWISE
      shapeType      SOLID
      faceType       CONVEX
      creaseAngle    0.5
   }
ShapeHints node tells the VRML browser about the object, so that optimization can be done during rendering. The creaseAngle field tells the browser to do a smooth transition from one polygon to another. This will have more pronounced effect on a curved surface.

   Coordinate3 {
      point [
         0    5   0,
        -2.5  0  -2.5,
         2.5  0  -2.5,
         2.5  0   2.5,
        -2.5  0   2.5
      ]
   }
   IndexedFaceSet {
      coordIndex [
         0, 4, 3, -1,  # Counter-Clockwise
         0, 3, 2, -1,  # Clockwise
         0, 2, 1, -1,  # Counter-Clockwise
         0, 1, 4, -1,  # Clockwise
         1, 3, 4, -1,  # Counter-Clockwise
         1, 2, 3, -1   # Counter-Clockwise
      ]
   }
}
The visual effect of this mistake depends on the browser.