X3D Model Documentation: SoundVisualization.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2  <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
  3  <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'>
  4       <head>
  5            <meta name='titlecontent='SoundVisualization.x3d'/>
  6            <meta name='descriptioncontent='An example of the Sound node for testing X3D-Edit author-assist visualization'/>
  7            <meta name='createdcontent='15 November 2009'/>
  8            <meta name='modifiedcontent='27 October 2023'/>
  9            <meta name='Imagecontent='SoundVisualization.png'/>
 10            <meta name='referencecontent='https://X3dGraphics.com'/>
 11            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/X3dResources.html'/>
 12            <meta name='creatorcontent='Don Brutzman'/>
 13            <meta name='rightscontent='Copyright 2009, Daly Realism and Don Brutzman'/>
 14            <meta name='subjectcontent='X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com'/>
 15            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/SoundVisualization.x3d'/>
 16            <meta name='generatorcontent='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/>
 17            <meta name='licensecontent='../license.html'/>
 18       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: CoordinateAxes, GridXZ_20x20Fixed, NavInside, NavOutside, ViewAbove, ViewInside, ViewOutside, WaterSounds

Index for Viewpoint nodes: ViewAbove, ViewInside, ViewOutside
-->
 19       <Scene>
 20            <!-- Note that navigation mode shifts to WALK when ViewInside is bound, otherwise default is EXAMINE -->
 21            <WorldInfo title='SoundVisualization.x3d'/>
 22 
          <!-- ROUTE information for ViewOutside node:  [from isBound to NavOutside.set_bind ] -->
          <Viewpoint DEF='ViewOutsidedescription='outsideposition='0 8 40'/>
 23 
          <!-- ROUTE information for NavOutside node:  [from ViewOutside.isBound to set_bind ] [from ViewAbove.isBound to set_bind ] -->
          <NavigationInfo DEF='NavOutside'/>
 24            < ROUTE  fromNode='ViewOutside' fromField='isBound' toNode='NavOutside' toField='set_bind'/>
 25 
          <!-- ROUTE information for ViewInside node:  [from isBound to NavInside.set_bind ] -->
          <Viewpoint DEF='ViewInsidedescription='insideposition='0 1.6 6'/>
 26 
          <!-- ROUTE information for NavInside node:  [from ViewInside.isBound to set_bind ] -->
          <NavigationInfo DEF='NavInsidetype='"WALK" "ANY"'/>
 27            < ROUTE  fromNode='ViewInside' fromField='isBound' toNode='NavInside' toField='set_bind'/>
 28 
          <!-- ROUTE information for ViewAbove node:  [from isBound to NavOutside.set_bind ] -->
          <Viewpoint DEF='ViewAbovedescription='aboveorientation='1 0 0 -1.57079position='0 40 0'/>
 29            <Inline DEF='GridXZ_20x20Fixed'   url=' "../../Savage/Tools/Authoring/GridXZ_20x20Fixed.x3d" "https://savage.nps.edu/Savage/Tools/Authoring/GridXZ_20x20Fixed.x3d" "../../Savage/Tools/Authoring/GridXZ_20x20Fixed.wrl" "https://savage.nps.edu/Savage/Tools/Authoring/GridXZ_20x20Fixed.wrl" '/>
 30            < ROUTE  fromNode='ViewAbove' fromField='isBound' toNode='NavOutside' toField='set_bind'/>
 31            <!-- Sound node example -->
 32            <Sound direction='1 0 1location='-3 1.6 -3maxBack='6minBack='5'>
 33                 <AudioClip DEF='WaterSoundsdescription='Running Water'   url=' "aqua.wav" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/aqua.wav" '/>
 34            </Sound>
 35            <!-- ================== -->
 36            <!-- Sound outlines, patterned after https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/SoundAudioClip.x3d -->
 37            <!-- Approximate ellipsoidal footprints and envelope using Cylinders and Spheres, respectively -->
 38            <!-- Sound direction is x axis, so minimum-attenuation minLength = (minBack + minFront) and minRadius = minLength/2 along x axis -->
 39            <!-- and so width, height dimensions ~= maximum-attenuation halfwidth = maxWidth ~= 45 along y, z axes -->
 40            <!-- Ellipsoid focus is (0 0 0) but geometric center offset for spheroidal approximation is (-minBack + minRadius) -->
 41            <Transform rotation='0 1 0 -2.356194490192345translation='-3 1.6 -3'>
 42                 <Transform rotation='1 0 0 0.0'>
 43                      <!-- here is local center of sound ellipse, with local X axis pointed along direction vector -->
 44                      <Inline DEF='CoordinateAxes'   url=' "../Chapter03Grouping/CoordinateAxes.x3d" "../../Savage/Tools/Authoring/CoordinateAxes.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "https://savage.nps.edu/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://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.wrl" '/>
 45                      <Transform scale='6.0 2.23606797749979 2.23606797749979translation='-2 0 0'>
 46                           <Collision enabled='false'>
 47                                <Shape>
 48                                     <Cylinder height='0.04radius='0.5side='false'/>
 49                                     <Appearance>
 50                                          <Material diffuseColor='0.8 0.6 0.4emissiveColor='0.8 0.6 0.4transparency='0.7'/>
 51                                     </Appearance>
 52                                </Shape>
 53                                <Shape>
 54                                     <Sphere radius='0.5'/>
 55                                     <Appearance>
 56                                          <Material diffuseColor='0.8 0.6 0.4emissiveColor='0.8 0.6 0.4transparency='0.7'/>
 57                                     </Appearance>
 58                                </Shape>
 59                           </Collision>
 60                      </Transform>
 61                      <Transform scale='16.0 7.745966692414834 7.745966692414834translation='2 0 0'>
 62                           <Collision enabled='false'>
 63                                <Shape>
 64                                     <Cylinder height='0.02radius='0.5side='false'/>
 65                                     <Appearance>
 66                                          <Material diffuseColor='0.4 0.3 0.2emissiveColor='0.4 0.3 0.2transparency='0.85'/>
 67                                     </Appearance>
 68                                </Shape>
 69                                <Shape>
 70                                     <Sphere radius='0.5'/>
 71                                     <Appearance>
 72                                          <Material diffuseColor='0.4 0.3 0.2emissiveColor='0.4 0.3 0.2transparency='0.85'/>
 73                                     </Appearance>
 74                                </Shape>
 75                           </Collision>
 76                      </Transform>
 77                 </Transform>
 78            </Transform>
 79            <!-- ================== -->
 80       </Scene>
 81  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: CoordinateAxes, GridXZ_20x20Fixed, NavInside, NavOutside, ViewAbove, ViewInside, ViewOutside, WaterSounds

Index for Viewpoint nodes: ViewAbove, ViewInside, ViewOutside
-->
X3D Tooltips element index: Appearance, AudioClip, Collision, Cylinder, head, Inline, Material, meta, NavigationInfo, ROUTE, Scene, Shape, Sound, Sphere, Transform, Viewpoint, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

Event Graph ROUTE Table entries with 3 ROUTE connections total, showing X3D event-model relationships for this scene.

Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.

ViewAbove
Viewpoint
isBound
SFBool

ROUTE
event to
(1)
NavOutside
NavigationInfo
set_bind
SFBool

ViewInside
Viewpoint
isBound
SFBool

ROUTE
event to
(1)
NavInside
NavigationInfo
set_bind
SFBool

ViewOutside
Viewpoint
isBound
SFBool

ROUTE
event to
(1)
NavOutside
NavigationInfo
set_bind
SFBool


Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/SoundVisualizationIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/SoundVisualization.x3d -->

<!-- Color-coding legend: X3D terminology <X3dNode  DEF='idNamefield='value'/> matches XML terminology <XmlElement  DEF='idNameattribute='value'/>
(Light-blue background: event-based behavior node or statement) (Grey background inside box: inserted documentation) (Magenta background: X3D Extensibility)
-->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->