<<VRML 2.0 - An Introductory view by examples

PixelTexture

[example]                                         [run-example]


It is a node that defines a texture map for mapping to a geometry.

{
exposedField SFImage image 0 0 0 # (width) (height) (# components) (pixel values)
field SFBool repeatS TRUE # texture wraps in S direction (filling tha shape)
field SFBool repeatT TRUE # texture wraps in T direction (filling tha shape)
}

Usage :


# black - white texture

   Shape {
     geometry ElevationGrid {
              .......
                             }
     appearance Appearance {
     texture PixelTexture {
     image 2 2 1 0xFF  0x80  0x80  0xFF  # width height mono width x height
                      opaque opaque
                           }
                            }
          }