#VRML V2.0 utf8 # #
#return : [ElevationGrid] , [PixelTexture], [TextureCoordinate] #

#ex-elevationgrid.wrl
# example of ElevationGrid geometry

# Camera
Viewpoint {
   position    -8 3 4
   orientation  0 1 0 -1.7 # looking al x+ direction
   fieldOfView 0.785398
}

# Illumination
PointLight{
           location 0 10 0
           }

Transform {
 translation 1 0 0
 children [
 Shape {
# defining a rug coposed of 20 patches (4x5)
  geometry ElevationGrid {
        ccw  TRUE  # system's normal following the right hand rule
        solid FALSE # it's not a solid
# note the distortation effect achieved by  varying the texture coordinates
        texCoord TextureCoordinate{
                    point [ 0 0, 1 0, 1 .75, 1 1.5,
                            .25 .25, 1 0, .75 .75, 1 .9,
                            0 0, 1 2, 4 4.75, 6 5.5,
                            0 0, 1 0, 1 .75, 1 1.5,
                            0 0, 1 0, 1 .75, 1 1.5]
                                    }

        height [0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 5, 5, 5, 5, 3, 3, 3, 3]
        xDimension 4
        xSpacing 2.0
        zDimension 5
        zSpacing 2.0
                           }
# the TextureCoordinate maps into these values
 appearance Appearance {
      texture PixelTexture {
      image 2 2 1 0xFF  0x80  0x80  0xFF  # width height mono width x height
#                      opaque opaque
                            }
                         }
        }
          ]
          }

#