Virtual Worlds  
By Andrea Ames
Web Techniques, July 1997

Web Techniques grants permission to use these listings for private or 
commercial use provided that credit to Web Techniques and the author is 
maintained within the comments of the source. For questions, contact
editors@web-techniques.com.

 
LISTING ONE
#VRML V2.0 utf8
Shape {
    appearance Appearance {
        material Material { }
        texture ImageTexture {
            url "brick.gif"
        }
    }
    geometry Box { }
LISTING TWO
Shape {
    appearance Appearance {
        texture PixelTexture {
            # the following line defines        
            # a 1-pixel wide, 2-pixel 
            # high, 3-byte RGB image
            image 1 2 3
                # the following line 
                # specifies yellow for 
                # the left-most, 
                # bottom-most pixel
                0xFFFF00
                # the following line 
                # specifies red for
                # the right-most, 
                # top-most pixel
                0xFF0000
        }
        material Material {}
    }
LISTING THREE
#VRML V2.0 utf8
Group {
    children [
        Shape {
            appearance Appearance {
                material Material { }
                texture ImageTexture {
                    url "top.gif"
                }
            }
            geometry Cylinder {
                bottom FALSE
                side FALSE
                height 2.7
            }
        }
        Shape {
            appearance Appearance {
                material Material { }
                texture ImageTexture {
                    url "bottom.gif"
                }
            }
            geometry Cylinder {
                top FALSE
                side FALSE
                height 2.7
            }
        }
        Shape {
            appearance Appearance {
                material Material { }
                texture ImageTexture {
                    url "label.gif"
                }
            }
            geometry Cylinder {
                top FALSE
                bottom FALSE
                height 2.7
            }
        }
    ]
LISTING FOUR
#VRML V2.0 utf8
Group {
    children [
        Shape {
            appearance Appearance {
                material Material { }
            }
            geometry IndexedFaceSet {
                coord Coordinate {
                    point [
                        -5.0 0.0  5.0,  5.0 0.0  5.0,
                         5.0 0.0 -5.0, -5.0 0.0 -5.0,
                    ]
                }
                coordIndex [ 0, 1, 2, 3 ]
                solid FALSE
            }
        },
        Shape {
            appearance Appearance {
                texture ImageTexture {
                    url "trans_tree.gif"
                }
            }
            geometry IndexedFaceSet {
                coord Coordinate {
                    point [
                        -1.51 0.0 0.0,   1.51 0.0 0.0,
                         1.51 3.0 0.0,  -1.51 3.0 0.0,
                    ]
                }
                coordIndex [ 0, 1, 2, 3 ]
                solid FALSE
            }
        }
    ]