<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<X3D profile='Immersive' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'>
  <head>
    <meta content='SoundVisualization.x3d' name='title'/>
    <meta content='An example of the Sound node for testing X3D-Edit author-assist visualization' name='description'/>
    <meta content='15 November 2009' name='created'/>
    <meta content='2 March 2026' name='modified'/>
    <meta content='SoundVisualization.png' name='Image'/>
    <meta content='https://X3dGraphics.com' name='reference'/>
    <meta content='https://www.web3d.org/x3d/content/examples/X3dResources.html' name='reference'/>
    <meta content='Don Brutzman' name='creator'/>
    <meta content='Copyright 2009, Daly Realism and Don Brutzman' name='rights'/>
    <meta content='X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com' name='subject'/>
    <meta content='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/SoundVisualization.x3d' name='identifier'/>
    <meta content='X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='../license.html' name='license'/>
  </head>
  <Scene>
    <!-- Note that navigation mode shifts to WALK when ViewInside is bound, otherwise default is EXAMINE -->
    <WorldInfo title='SoundVisualization.x3d'/>
    <Viewpoint DEF='ViewOutside' description='outside' position='0 8 40'/>
    <NavigationInfo DEF='NavOutside'/>
    <ROUTE fromField='isBound' fromNode='ViewOutside' toField='set_bind' toNode='NavOutside'/>
    <Viewpoint DEF='ViewInside' description='inside' position='0 1.6 6'/>
    <NavigationInfo DEF='NavInside' type='"WALK" "ANY"'/>
    <ROUTE fromField='isBound' fromNode='ViewInside' toField='set_bind' toNode='NavInside'/>
    <Viewpoint DEF='ViewAbove' description='above' orientation='1 0 0 -1.57079' position='0 40 0'/>
    <Inline DEF='GridXZ_20x20Fixed' url='"../../Savage/Tools/Authoring/GridXZ_20x20Fixed.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/GridXZ_20x20Fixed.x3d" "../../Savage/Tools/Authoring/GridXZ_20x20Fixed.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/GridXZ_20x20Fixed.wrl"'/>
    <ROUTE fromField='isBound' fromNode='ViewAbove' toField='set_bind' toNode='NavOutside'/>
    <!-- Sound node example -->
    <Sound direction='1 0 1' location='-3 1.6 -3' maxBack='6' minBack='5'>
      <AudioClip DEF='WaterSounds' description='Running Water' url='"aqua.wav" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/aqua.wav"'/>
    </Sound>
    <!-- ================== -->
    <!-- Sound outlines, patterned after https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/SoundAudioClip.x3d -->
    <!-- Approximate ellipsoidal footprints and envelope using Cylinders and Spheres, respectively -->
    <!-- Sound direction is x axis, so minimum-attenuation minLength = (minBack + minFront) and minRadius = minLength/2 along x axis -->
    <!-- and so width, height dimensions ~= maximum-attenuation halfwidth = maxWidth ~= 45 along y, z axes -->
    <!-- Ellipsoid focus is (0 0 0) but geometric center offset for spheroidal approximation is (-minBack + minRadius) -->
    <Transform rotation='0 1 0 -2.356194490192345' translation='-3 1.6 -3'>
      <Transform rotation='1 0 0 0.0'>
        <!-- here is local center of sound ellipse, with local X axis pointed along direction vector -->
        <Inline DEF='CoordinateAxes' url='"../Chapter03Grouping/CoordinateAxes.x3d" "../../Savage/Tools/Authoring/CoordinateAxes.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.x3d" "../Chapter03Grouping/CoordinateAxes.wrl" "../../Savage/Tools/Authoring/CoordinateAxes.wrl" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.wrl"'/>
        <Transform scale='6.0 2.23606797749979 2.23606797749979' translation='-2 0 0'>
          <Collision enabled='false'>
            <Shape>
              <Cylinder height='0.04' radius='0.5' side='false'/>
              <Appearance>
                <Material diffuseColor='0.8 0.6 0.4' emissiveColor='0.8 0.6 0.4' transparency='0.7'/>
              </Appearance>
            </Shape>
            <Shape>
              <Sphere radius='0.5'/>
              <Appearance>
                <Material diffuseColor='0.8 0.6 0.4' emissiveColor='0.8 0.6 0.4' transparency='0.7'/>
              </Appearance>
            </Shape>
          </Collision>
        </Transform>
        <Transform scale='16.0 7.745966692414834 7.745966692414834' translation='2 0 0'>
          <Collision enabled='false'>
            <Shape>
              <Cylinder height='0.02' radius='0.5' side='false'/>
              <Appearance>
                <Material diffuseColor='0.4 0.3 0.2' emissiveColor='0.4 0.3 0.2' transparency='0.85'/>
              </Appearance>
            </Shape>
            <Shape>
              <Sphere radius='0.5'/>
              <Appearance>
                <Material diffuseColor='0.4 0.3 0.2' emissiveColor='0.4 0.3 0.2' transparency='0.85'/>
              </Appearance>
            </Shape>
          </Collision>
        </Transform>
      </Transform>
    </Transform>
    <!-- ================== -->
  </Scene>
</X3D>