Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 5: Positioning Shapes

../ch05/05fig11.gif
Figure 5.11

Nesting coordinate systems

05fig11.wrl
Click on the image to view the VRML scene.

#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright (c) 1997
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Group {
    children [
    # Ground
        Shape {
            appearance DEF White Appearance {
                material Material { }
            }
            geometry Box {
                size 25.0 0.1 25.0
            }
        },
    # First archway
    # Left Column
        DEF LeftColumn Transform {
            translation -2.0 3.0 0.0
            children DEF Column Shape {
                appearance USE White
                geometry Cylinder {
                    radius 0.3
                    height 6.0
                }
            }
        },
    # Right Column
        DEF RightColumn Transform {
            translation 2.0 3.0 0.0
            children USE Column
        },
    # Archway span
        DEF ArchwaySpan Transform {
            translation 0.0 6.05 0.0
            children Shape {
                appearance USE White
                geometry Box {
                    size 4.6 0.4 0.6
                }
            }
        },
    # Second archway
        Transform {
            translation 0.0 0.0 -2.0
            children [
                USE LeftColumn,
                USE RightColumn,
                USE ArchwaySpan
            ]
        }
    ]
}