X3D Model Documentation: SoundAudioClip.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='SoundAudioClip.x3d'/>
  6            <meta name='descriptioncontent='An example of the Sound and AudioClip node showing the effect of the various volume regions'/>
  7            <meta name='createdcontent='1 May 2006'/>
  8            <meta name='modifiedcontent='13 May 2020'/>
  9            <meta name='referencecontent='https://X3dGraphics.com'/>
 10            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/X3dResources.html'/>
 11            <meta name='creatorcontent='Don Brutzman'/>
 12            <meta name='rightscontent='Copyright 2006, Daly Realism and Don Brutzman'/>
 13            <meta name='subjectcontent='X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com'/>
 14            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/SoundAudioClip.x3d'/>
 15            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 16            <meta name='licensecontent='../license.html'/>
 17       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: Audible, MaxFootprintMaterial, maxShapes, MaxSpheroidMaterial, MinFootprintMaterial, minShapes, MinSpheroidMaterial, WaterSounds

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2, Viewpoint_3, Viewpoint_4, Viewpoint_5, Viewpoint_6

Index for ExternProtoDeclare definition: GridXZ
-->
 18       <Scene>
 19            <WorldInfo title='SoundAudioClip.x3d'/>
 20            <Viewpoint description='Sound spheroid approximating ellipsoid volumeorientation='1 0 0 -0.2position='0 40 200'/>
 21            <Viewpoint description='100m distantorientation='1 0 0 -0.2position='0 20 100'/>
 22            <Viewpoint description='50m distantorientation='1 0 0 -0.2position='0 10 50'/>
 23            <Viewpoint description='25m distantorientation='1 0 0 -0.2position='0 5 25'/>
 24            <Viewpoint description='10m distantorientation='1 0 0 -0.2position='0 2 10'/>
 25            <Viewpoint description='centerorientation='0 1 0 -1.57position='0 2 0'/>
 26            <NavigationInfo speed='10type='"WALK" "ANY"'/>
 27            <!-- Sound node is positioned and oriented in local coordinate reference frame of scene graph at origin of sound -->
 28            <!-- Sound location y-value is 1.6 in order to match typical avatar height (in meters) -->
 29            <Sound DEF='Audiblelocation='0 1.6 0maxBack='20maxFront='100minBack='10minFront='10priority='1'>
 30                 <AudioClip DEF='WaterSoundsdescription='Running Waterloop='true'   url=' "aqua.wav" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/aqua.wav" '/>
 31            </Sound>
 32            <!-- minWidth = sqrt (minBack * minFront) = 10 -->
 33            <!-- maxWidth = sqrt (maxBack * maxFront) = 45 -->
 34            <!-- Approximate ellipsoidal footprints and envelope using Cylinders and Spheres, respectively -->
 35            <!-- Minimum attenuation parameters 10, 10, 10 produce a Cylinder and Sphere with uniform scale -->
 36            <Transform DEF='minShapesscale='10 10 10'>
 37                 <Shape>
 38                      <Cylinder height='0.05'/>
 39                      <Appearance>
 40                           <Material DEF='MinFootprintMaterialdiffuseColor='0.8 0 0'/>
 41                      </Appearance>
 42                 </Shape>
 43                 <Collision enabled='false'>
 44                      <Shape>
 45                           <Sphere/>
 46                           <Appearance>
 47                                <Material DEF='MinSpheroidMaterialdiffuseColor='0.8 0 0transparency='0.5'/>
 48                           </Appearance>
 49                      </Shape>
 50                 </Collision>
 51            </Transform>
 52            <!-- Maximum attenuation parameters 20, 100, 45 produce a Cylinder and Sphere with non-uniform scale -->
 53            <!-- Sound direction is x axis, so maximum-attenuation length = (100 + 20) = 120 and radius = 120 / 2 = 60 along x axis -->
 54            <!-- and so width, height dimensions ~= maximum-attenuation halfwidth = maxWidth ~= 45 along y, z axes -->
 55            <!-- Ellipsoid focus is (0 0 0) but geometric center of spheroidal approximation is (-maxBack + x radius) = (-20 + 60) = 40 along x axis -->
 56            <Transform DEF='maxShapesscale='60 45 45translation='40 0 0'>
 57                 <Shape>
 58                      <Cylinder height='0.002'/>
 59                      <Appearance>
 60                           <Material DEF='MaxFootprintMaterialdiffuseColor='1 0.894118 0.341176'/>
 61                      </Appearance>
 62                 </Shape>
 63                 <Collision enabled='false'>
 64                      <Shape>
 65                           <Sphere/>
 66                           <Appearance>
 67                                <Material DEF='MaxSpheroidMaterialdiffuseColor='1 0.5 0transparency='0.75'/>
 68                           </Appearance>
 69                      </Shape>
 70                 </Collision>
 71            </Transform>
 72            <!-- Author-assist prototype from Savage X3D model archive -->
 73            <ExternProtoDeclare name='GridXZ'   url=' "../../Savage/Tools/Authoring/GridXZPrototype.x3d#GridXZ" "https://savage.nps.edu/Savage/Tools/Authoring/GridXZPrototype.x3d#GridXZ" "../../Savage/Tools/Authoring/GridXZPrototype.wrl#GridXZ" "https://savage.nps.edu/Savage/Tools/Authoring/GridXZPrototype.wrl#GridXZ" '>
 74                 <field name='descriptiontype='SFStringaccessType='initializeOnly'/>
 75                 <field name='labelColortype='SFColoraccessType='inputOutput'/>
 76                 <field name='scaletype='SFVec3faccessType='inputOutput'
                appinfo='default unscaled size: 10m by 10m'/>
 77                 <field name='labelsOffsettype='SFVec3faccessType='inputOutput'
                appinfo='label location offset (in meters) to improve readability'/>
 78                 <field name='originLabeltype='MFStringaccessType='inputOutput'/>
 79                 <field name='WestLabeltype='MFStringaccessType='inputOutput'
                appinfo='-Z axis'/>
 80                 <field name='NorthWestLabeltype='MFStringaccessType='inputOutput'/>
 81                 <field name='NorthLabeltype='MFStringaccessType='inputOutput'
                appinfo='+X axis'/>
 82                 <field name='NorthEastLabeltype='MFStringaccessType='inputOutput'/>
 83                 <field name='EastLabeltype='MFStringaccessType='inputOutput'
                appinfo='+Z axis'/>
 84                 <field name='SouthEastLabeltype='MFStringaccessType='inputOutput'/>
 85                 <field name='SouthLabeltype='MFStringaccessType='inputOutput'
                appinfo='-X axis'/>
 86                 <field name='SouthWestLabeltype='MFStringaccessType='inputOutput'/>
 87            </ExternProtoDeclare>
 88            <!-- default values scaled up by factor of 10 in this instance -->
 89            <ProtoInstance name='GridXZ'>
 90                 <fieldValue name='descriptionvalue='GridXZ'/>
 91                 <fieldValue name='labelColorvalue='1 1 1'/>
 92                 <fieldValue name='scalevalue='10 10 10'/>
 93                 <fieldValue name='labelsOffsetvalue='0 -0.5 0'/>
 94                 <fieldValue name='originLabelvalue='"origin" "0 0 0"'/>
 95                 <fieldValue name='NorthLabelvalue='"North" "-Z"'/>
 96                 <fieldValue name='NorthEastLabelvalue='"100 0 -100"'/>
 97                 <fieldValue name='EastLabelvalue='"East" "+X"'/>
 98                 <fieldValue name='SouthEastLabelvalue='"100 0 100"'/>
 99                 <fieldValue name='SouthLabelvalue='"South" "+Z"'/>
100                 <fieldValue name='SouthWestLabelvalue='"-100 0 100"'/>
101                 <fieldValue name='WestLabelvalue='"West" "-X"'/>
102                 <fieldValue name='NorthWestLabelvalue='"-100 0 -100"'/>
103            </ProtoInstance>
104       </Scene>
105  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: Audible, MaxFootprintMaterial, maxShapes, MaxSpheroidMaterial, MinFootprintMaterial, minShapes, MinSpheroidMaterial, WaterSounds

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2, Viewpoint_3, Viewpoint_4, Viewpoint_5, Viewpoint_6

Index for ExternProtoDeclare definition: GridXZ
-->
X3D Tooltips element index: Appearance, AudioClip, Collision, Cylinder, ExternProtoDeclare, field, fieldValue, head, Material, meta, NavigationInfo, ProtoInstance, Scene, Shape, Sound, Sphere, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

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

<!-- Color 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)
    <ProtoInstance name='ProtoName'> <field name='fieldName'/> ProtoInstance> -->

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