Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 11: Grouping

../ch11/11fig02.gif
Figure 11.2

A caf� sign within a billboard group.

11fig02.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 [
    # Cafe Sign in a Billboard group
        Billboard {
            axisOfRotation 0.0 1.0 0.0
            children [
                DEF Cafe Shape {
                    appearance DEF GlowWhite Appearance {
                        material Material {
                            emissiveColor 1.0 1.0 1.0
                            diffuseColor  0.0 0.0 0.0
                        }
                    }
                    geometry Text {
                        string "Cafe"
                        fontStyle FontStyle {
                            justify "MIDDLE"
                        }
                    }
                },
                DEF BlueDisk Transform {
                    translation 0.0 0.3 -0.10
                    rotation    1.0 0.0 0.0 -1.57
                    children Shape {
                        appearance Appearance {
                            material Material {
                                diffuseColor  0.0 0.3 0.8
                            }
                        }
                        geometry Cylinder {
                            radius 1.3
                            height 0.1
                        }
                    }
                },
                DEF WhiteDisk Transform {
                    translation 0.0 0.3 -0.10
                    rotation    1.0 0.0 0.0 -1.57
                    children [
                        Shape {
                            appearance USE GlowWhite
                            geometry Cylinder {
                                radius 1.4
                                height 0.08
                            }
                        }
                    ]
                },
                DEF RedAndWhiteBoxes Transform {
                    translation 0.0 0.3 -0.10
                    children [
                        Shape {
                            appearance Appearance {
                                material Material {
                                    diffuseColor 0.8 0.0 0.0
                                }
                            }
                            geometry Box {
                                size 4.0 1.2 0.06
                            }
                        },
                        Shape {
                            appearance USE GlowWhite
                            geometry Box {
                                size 4.2 1.4 0.04
                            }
                        }
                    ]
                }
            ]
        },
    # Non-billboard sign pole and ground
        DEF Pole Transform {
            translation 0.0 -3.1 -0.10
            children Shape {
                appearance DEF Gray Appearance {
                    material Material {
                        diffuseColor 0.6 0.6 0.6
                    }
                }
                geometry Box {
                    size 0.4 4.0 0.4
                }
            }
        },
        DEF PoleBase Transform {
            translation 0.0 -5.2 -0.10
            children Shape {
                appearance USE Gray
                geometry Box {
                    size 1.0 0.2 1.0
                }
            }
        },
        DEF Ground Transform {
            translation 0.0 -5.35 -0.10
            children Shape {
                appearance USE Gray
                geometry Box {
                    size 10.0 0.1 10.0
                }
            }
        }
    ]
}