{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Immersive",
    "@version":"3.3",
    "@xsd:noNamespaceSchemaLocation":"https://www.web3d.org/specifications/x3d-3.3.xsd",
    "JSON schema":"https://www.web3d.org/specifications/x3d-4.0-JSONSchema.autogenerated.json",
    "head": {
        "meta": [
          {
            "@name":"title",
            "@content":"SoundAudioClip.x3d"
          },
          {
            "@name":"description",
            "@content":"An example of the Sound and AudioClip node showing the effect of the various volume regions"
          },
          {
            "@name":"created",
            "@content":"1 May 2006"
          },
          {
            "@name":"modified",
            "@content":"2 March 2026"
          },
          {
            "@name":"reference",
            "@content":"https://X3dGraphics.com"
          },
          {
            "@name":"reference",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dResources.html"
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman"
          },
          {
            "@name":"rights",
            "@content":"Copyright 2006, Daly Realism and Don Brutzman"
          },
          {
            "@name":"subject",
            "@content":"X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/SoundAudioClip.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../license.html"
          },
          {
            "@name":"translated",
            "@content":"17 April 2026"
          },
          {
            "@name":"generator",
            "@content":"X3dToJson.xslt, https://www.web3d.org/x3d/stylesheets/X3dToJson.html"
          },
          {
            "@name":"reference",
            "@content":"X3D JSON encoding: https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding"
          }
        ]
    },
    "Scene": {
        "-children":[
          { "WorldInfo":
            {
              "@title":"SoundAudioClip.x3d"
            }
          },
          { "NavigationInfo":
            {
              "@speed":10,
              "@type":["FLY","ANY"]
            }
          },
          { "Viewpoint":
            {
              "@description":"Sound spheroid approximating ellipsoid volume",
              "@orientation":[1,0,0,-0.2],
              "@position":[0,40,200]
            }
          },
          { "Viewpoint":
            {
              "@description":"100m distant",
              "@orientation":[1,0,0,-0.2],
              "@position":[0,20,100]
            }
          },
          { "Viewpoint":
            {
              "@description":"50m distant",
              "@orientation":[1,0,0,-0.2],
              "@position":[0,10,50]
            }
          },
          { "Viewpoint":
            {
              "@description":"25m distant",
              "@orientation":[1,0,0,-0.2],
              "@position":[0,5,25]
            }
          },
          { "Viewpoint":
            {
              "@description":"10m distant",
              "@orientation":[1,0,0,-0.2],
              "@position":[0,2,10]
            }
          },
          { "Viewpoint":
            {
              "@description":"center",
              "@orientation":[0,1,0,-1.57],
              "@position":[0,2,0]
            }
          },
          {
            "#comment":"Sound node is positioned and oriented in local coordinate reference frame of scene graph at origin of sound"
          },
          {
            "#comment":"Sound location y-value is 1.6 in order to match typical avatar height (in meters)"
          },
          { "Sound":
            {
              "@DEF":"Audible",
              "@location":[0,1.6,0],
              "@maxBack":20,
              "@maxFront":100,
              "@minBack":10,
              "@minFront":10,
              "@priority":1,
              "-source":
                { "AudioClip":
                  {
                    "@DEF":"WaterSounds",
                    "@description":"Running Water",
                    "@loop":true,
                    "@url":["aqua.wav","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/aqua.wav"]
                  }
                }
            }
          },
          {
            "#comment":"minWidth = sqrt (minBack * minFront) = 10"
          },
          {
            "#comment":"maxWidth = sqrt (maxBack * maxFront) = 45"
          },
          {
            "#comment":"Approximate ellipsoidal footprints and envelope using Cylinders and Spheres, respectively"
          },
          {
            "#comment":"Minimum attenuation parameters 10, 10, 10 produce a Cylinder and Sphere with uniform scale"
          },
          { "Transform":
            {
              "@DEF":"minShapes",
              "@scale":[10,10,10],
              "-children":[
                { "Shape":
                  {
                    "-geometry":
                      { "Cylinder":
                        {
                          "@height":0.05
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@DEF":"MinFootprintMaterial",
                                "@diffuseColor":[0.8,0,0]
                              }
                            }
                        }
                      }
                  }
                },
                { "Collision":
                  {
                    "@enabled":false,
                    "-children":[
                      { "Shape":
                        {
                          "-geometry":
                            { "Sphere":
                              {
                              }
                            },
                          "-appearance":
                            { "Appearance":
                              {
                                "-material":
                                  { "Material":
                                    {
                                      "@DEF":"MinSpheroidMaterial",
                                      "@diffuseColor":[0.8,0,0],
                                      "@transparency":0.5
                                    }
                                  }
                              }
                            }
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          {
            "#comment":"Maximum attenuation parameters 20, 100, 45 produce a Cylinder and Sphere with non-uniform scale"
          },
          {
            "#comment":"Sound direction is x axis, so maximum-attenuation length = (100 + 20) = 120 and radius = 120 / 2 = 60 along x axis"
          },
          {
            "#comment":"and so width, height dimensions ~= maximum-attenuation halfwidth = maxWidth ~= 45 along y, z axes"
          },
          {
            "#comment":"Ellipsoid focus is (0 0 0) but geometric center of spheroidal approximation is (-maxBack + x radius) = (-20 + 60) = 40 along x axis"
          },
          { "Transform":
            {
              "@DEF":"maxShapes",
              "@scale":[60,45,45],
              "@translation":[40,0,0],
              "-children":[
                { "Shape":
                  {
                    "-geometry":
                      { "Cylinder":
                        {
                          "@height":0.002
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@DEF":"MaxFootprintMaterial",
                                "@diffuseColor":[1,0.894118,0.341176]
                              }
                            }
                        }
                      }
                  }
                },
                { "Collision":
                  {
                    "@enabled":false,
                    "-children":[
                      { "Shape":
                        {
                          "-geometry":
                            { "Sphere":
                              {
                              }
                            },
                          "-appearance":
                            { "Appearance":
                              {
                                "-material":
                                  { "Material":
                                    {
                                      "@DEF":"MaxSpheroidMaterial",
                                      "@diffuseColor":[1,0.5,0],
                                      "@transparency":0.75
                                    }
                                  }
                              }
                            }
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          {
            "#comment":"Author-assist prototype from Savage X3D model archive"
          },
          { "ExternProtoDeclare":
            {
              "@name":"GridXZ",
              "@url":["../../Savage/Tools/Authoring/GridXZPrototype.x3d#GridXZ","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/GridXZPrototype.x3d#GridXZ","../../Savage/Tools/Authoring/GridXZPrototype.wrl#GridXZ","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/GridXZPrototype.wrl#GridXZ"],
              "field": [
                {
                  "@name":"description",
                  "@accessType":"initializeOnly",
                  "@type":"SFString"
                },
                {
                  "@name":"labelColor",
                  "@accessType":"inputOutput",
                  "@type":"SFColor"
                },
                {
                  "@name":"scale",
                  "@accessType":"inputOutput",
                  "@appinfo":"default unscaled size: 10m by 10m",
                  "@type":"SFVec3f"
                },
                {
                  "@name":"labelsOffset",
                  "@accessType":"inputOutput",
                  "@appinfo":"label location offset (in meters) to improve readability",
                  "@type":"SFVec3f"
                },
                {
                  "@name":"originLabel",
                  "@accessType":"inputOutput",
                  "@type":"MFString"
                },
                {
                  "@name":"WestLabel",
                  "@accessType":"inputOutput",
                  "@appinfo":"-Z axis",
                  "@type":"MFString"
                },
                {
                  "@name":"NorthWestLabel",
                  "@accessType":"inputOutput",
                  "@type":"MFString"
                },
                {
                  "@name":"NorthLabel",
                  "@accessType":"inputOutput",
                  "@appinfo":"+X axis",
                  "@type":"MFString"
                },
                {
                  "@name":"NorthEastLabel",
                  "@accessType":"inputOutput",
                  "@type":"MFString"
                },
                {
                  "@name":"EastLabel",
                  "@accessType":"inputOutput",
                  "@appinfo":"+Z axis",
                  "@type":"MFString"
                },
                {
                  "@name":"SouthEastLabel",
                  "@accessType":"inputOutput",
                  "@type":"MFString"
                },
                {
                  "@name":"SouthLabel",
                  "@accessType":"inputOutput",
                  "@appinfo":"-X axis",
                  "@type":"MFString"
                },
                {
                  "@name":"SouthWestLabel",
                  "@accessType":"inputOutput",
                  "@type":"MFString"
                }
              ]
            }
          },
          {
            "#comment":"default values scaled up by factor of 10 in this instance"
          },
          { "ProtoInstance":
            {
              "@name":"GridXZ",
              "fieldValue": [
                {
                  "@name":"description",
                  "@value":"GridXZ"
                },
                {
                  "@name":"labelColor",
                  "@value":[1,1,1]
                },
                {
                  "@name":"scale",
                  "@value":[10,10,10]
                },
                {
                  "@name":"labelsOffset",
                  "@value":[0,-0.5,0]
                },
                {
                  "@name":"originLabel",
                  "@value":["origin","0 0 0"]
                },
                {
                  "@name":"NorthLabel",
                  "@value":["North","-Z"]
                },
                {
                  "@name":"NorthEastLabel",
                  "@value":["100 0 -100"]
                },
                {
                  "@name":"EastLabel",
                  "@value":["East","+X"]
                },
                {
                  "@name":"SouthEastLabel",
                  "@value":["100 0 100"]
                },
                {
                  "@name":"SouthLabel",
                  "@value":["South","+Z"]
                },
                {
                  "@name":"SouthWestLabel",
                  "@value":["-100 0 100"]
                },
                {
                  "@name":"WestLabel",
                  "@value":["West","-X"]
                },
                {
                  "@name":"NorthWestLabel",
                  "@value":["-100 0 -100"]
                }
              ]
            }
          }
        ]
    }
  }
}