This example shows how to assign a color to each vertex of the object.


#VRML V2.0 utf8

Group {
   children [
      Shape {
         appearance
         Appearance {
            material
            Material {
               ambientIntensity 0.1
               diffuseColor     1 1 0
            }
         }
         geometry
         IndexedFaceSet {
            coord
            Coordinate {
               point    [ 0 5 0,
                          -2.5 0 -2.5,
                          2.5 0 -2.5,
                          2.5 0 2.5,
                          -2.5 0 2.5 ]
            }

Six colors are defined, but only five are needed.  The colors are labeled
from 0 to 5. 

            color
            Color {
               color    [ 1 1 0,
                          0 1 1,
                          1 0 1,
                          1 0 0,
                          0 1 0,
                          0 0 1 ]
            }
            solid       FALSE
            creaseAngle 0.5
            coordIndex  [ 0, 4, 3, -1, 0, 3, 2, -1,
                          0, 2, 1, -1, 0, 1, 4, -1,
                          1, 3, 4, -1, 1, 2, 3, -1 ]
            colorIndex  [ 0, 4, 3, -1, 0, 3, 2, -1,
                          0, 2, 1, -1, 0, 1, 4, -1,
                          1, 3, 4, -1, 1, 2, 3, -1 ]
         }
      }
     ]
}