Elevation Grid Example: Chessboard

A chess board is made of 64 tiles, in a 8x8 grid. The tiles are colored black and white, so that two tiles sharing a side have different colors.

As far as defining the tiles, The ElevationGrid for this purpose is as follows:
 
 

     geometry ElevationGrid { 
        xDimension 9 
        zDimension 9 
        xSpacing 1 
        zSpacing 1 
        height [ 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0
        ]
    }
 
Note that the dimensions specified are the number of tiles plus one. The same goes for the list of heights, there are xDimension x zDimension height values specified.

Now we need to define the colors. First set the field colorPerVertex to FALSE. This implies that the colors defined are applied to each square of the chessboard, and not to the vertices.
 
Next set the color field to a Color node with 64 values, alternating between black and white. The complete code is as follows:
 
 

#VRML V2.0 utf8 

Shape { 

    geometry ElevationGrid {
        xDimension 9 
        zDimension 9 
        xSpacing 1 
        zSpacing 1 
        height [ 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0 
           0 0 0 0 0 0 0 0 0
        ]

    colorPerVertex FALSE 
      color Color { 
       color [ 
        0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 
        1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 
        0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 
        1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 
        0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 
        1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 
        0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 
        1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 1 1 1, 0 0 0, 
       ] 
      } 
     } 
    }