Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 25: Controlling Detail

../ch25/25fig08.gif
Figure 25.8

A dungeon room.

25fig08.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 [
    # Floor (two strips)
        Transform {
            translation 0.0 0.0 2.5
            children DEF Floor Inline { url "dfloor.wrl" }
        },
        Transform { translation 0.0 0.0 -2.5 children USE Floor },
    # Ceiling (reuse the floor)
        Transform { translation 0.0 3.5  2.5 children USE Floor },
        Transform { translation 0.0 3.5 -2.5 children USE Floor },
    # Left wall with torch
        Transform {
            translation -5.0 0.0 0.0
            children [
                Transform {
                    translation 0.0 0.0 2.5
                    children DEF Wall Inline { url "dwall.wrl" }
                },
                Transform { translation 0.0 0.0 -2.5 children USE Wall },
                Transform {
                    translation 0.0 2.25 0.0
                    rotation 0.0 1.0 0.0 1.57
                    children [
                        PointLight {
                            location 0.0 0.25 0.2
                            color 1.0 0.4 0.2
                            intensity 0.8
                            attenuation 0.0 0.6 0.0
                            radius 10.0
                        },
                        DEF Torch Inline { url "torches.wrl" }
                    ]
                }
            ]
        },
    # Right wall with torch
        Transform {
            translation 5.0 0.0 0.0
            children [
                Transform { translation 0.0 0.0  2.5 children USE Wall },
                Transform { translation 0.0 0.0 -2.5 children USE Wall },
                Transform {
                    translation 0.0 2.25 0.0
                    rotation 0.0 1.0 0.0 -1.57
                    children [
                        PointLight {
                            location 0.0 0.25 0.2
                            color 1.0 0.4 0.2
                            intensity 0.8
                            attenuation 0.0 0.6 0.0
                            radius 10.0
                        },
                        USE Torch
                    ]
                }
            ]
        }
    ]
}