"Virtual Worlds"
by  Andrea L. Ames
Web Techniques,  April 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
Group {
    children [
    # Ambient sound emitter
        Sound {
            source AudioClip {
                url "sound.wav" # Sound file in WAV format 
                loop TRUE
            }
            minFront 5.0
            minBack  5.0
            maxFront 10.0
            maxBack  10.0
        },
    # Sound-emitter indicator geometry (sphere)
        Shape {
            appearance Appearance {
                material Material {
                    diffuseColor  0.0 0.0 0.0
                    emissiveColor 1.0 1.0 1.0
                }
            }
            geometry Sphere { radius 0.25 }
        },
    # Inner ellipsoid (circle) marker (cylinder) 
    # indicating minimum sound range
        Shape {
            appearance Appearance {
                material Material {
                    diffuseColor  0.0 0.0 0.0
                    emissiveColor 1.0 0.0 0.5
                }
            }
            geometry Cylinder {
                radius 5.0
                height 0.01
                side   FALSE
                bottom FALSE
            }
        },
    # Outer ellipsoid (circle) marker (cylinder) 
    # indicating maximum sound range
        Shape {
            appearance Appearance {
                material Material {
                    diffuseColor  0.0 0.0 0.0
                    emissiveColor 0.5 0.0 1.0
                }
            }
            geometry Cylinder {
                radius 10.0
                height 0.001
                side   FALSE
                bottom FALSE
            }
        },
    ]
}
     
     
[LISTING TWO]
     
#VRML V2.0 utf8
Group {
    children [
    # Sound emitter with direction specified
        Sound {
            source AudioClip {
                url "sound.wav" # Sound file in WAV format 
                loop TRUE
            }
            direction 1.0 0.0 0.0
            minFront 5.0
            minBack  1.0
            maxFront 10.0
            maxBack  2.0
        },
    # Sound-emitter indicator geometry (sphere)
        Shape {
            appearance Appearance {
                material Material {
                    diffuseColor  0.0 0.0 0.0
                    emissiveColor 1.0 1.0 1.0
                }
            }
            geometry Sphere { radius 0.25 }
        },
    # Translated and scaled inner ellipsoid marker 
    # (cylinder) indicating minimum sound range
        Transform {
            translation 2.0 0.0 0.0
            scale 3.0 2.0 2.0
            children DEF MinMarker Shape {
                appearance Appearance {
                    material Material {
                        diffuseColor  0.0 0.0 0.0
                        emissiveColor 1.0 0.0 0.5
                    }
                }
                geometry Cylinder {
                    radius 1.0
                    height 0.01
                    side   FALSE
                    bottom FALSE
                }
            }
        },
    # Translated and scaled outer ellipsoid marker 
    # (cylinder) indicating maximum sound range
        Transform {
            translation 4.0 0.0 0.0
            scale 6.0 4.0 4.0
            children DEF MaxMarker Shape {
                appearance Appearance {
                    material Material {
                        diffuseColor  0.0 0.0 0.0
                        emissiveColor 0.5 0.0 1.0
                    }
                }
                geometry Cylinder {
                    radius 1.0
                    height 0.001
                    side   FALSE
                    bottom FALSE
                }
            }
        }
    ]
}