1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "https://www.web3d.org/specifications/x3d-4.0.dtd">
|
3 | <X3D profile='Full' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'> |
4 | <head> |
5 | <meta name='title' content='SpatialAudioCameraAnimation.x3d'/> |
6 | <meta name='description' content='In the last demo, there are two sound sources in different positions. Through the immersion in the X3D scene the user could attend a rational navigation. Whenever the camera moves in the direction of an existing sound source, the strength of this source increases, while the sound strength of the other (the second one) decreases and vice versa. Through this process, great realism of the scene is achieved, since it emulates the spatial sound in real world.'/> |
7 | <meta name='info' content='This work presents an innovative solution of the spatial sound in X3DOM framework, that based on a combinational methodology. Specifically, we suggested the enrichment of X3DOM with spatial sound features, using both the X3D sound nodes and the structure of Web Audio API.'/> |
8 | <meta name='creator' content='Efi Lakka, Athanasios Malamos, Dick Puk, Don Brutzman'/> |
9 | <meta name='created' content='28 October 2020'/> |
10 | <meta name='modified' content='5 December 2021'/> |
11 | <meta name='reference' content='CHANGELOG.txt'/> |
12 | <meta name=' TODO ' content=' credit for audio files '/> |
13 | <meta name='reference' content='https://www.medialab.hmu.gr/minipages/x3domAudio'/> |
14 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/SpatialAudioCameraAnimation.x3d'/> |
15 | <meta name='generator' content='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/> |
16 | <meta name='license' content='../license.html'/> |
17 | </head> |
18 | <Scene> |
19 | <WorldInfo title='SpatialAudioCameraAnimation.x3d'/> |
20 | <NavigationInfo id='NAV'/> |
21 | <Background backUrl=' "images/generic/BK1.png " "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/BK1.png " ' bottomUrl=' "images/generic/DN1.png " "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/DN1.png " ' frontUrl=' "images/generic/FR1.png " "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/FR1.png " ' leftUrl=' "images/generic/LF1.png " "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/LF1.png " ' rightUrl=' "images/generic/RT1.png " "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/RT1.png " ' topUrl=' "images/generic/UP1.png " "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/UP1.png " '/> |
22 |
<!-- ROUTE information for Camera001 node:
[from Camera001-POS-INTERP.value_changed to set_position
]
[from Camera001-ROT-INTERP.value_changed to set_orientation
]
-->
<Viewpoint DEF='Camera001' description='Viewpoint is like camera, prepositioned in locations (and directions) of interest. In this example the camera is the "ears of the user". So, if the trackCurrentView field from ListenerPointSource is TRUE then position and orientation matches the users current view' orientation='1 0 0 -0.523599' position='0 2000 3500'/> |
23 |
<!-- ROUTE information for TIMER node:
[from fraction_changed to Camera001-POS-INTERP.set_fraction
]
[from fraction_changed to Camera001-ROT-INTERP.set_fraction
]
-->
<TimeSensor DEF='TIMER' cycleInterval='33.333332' loop='true'/> |
24 |
<!-- ROUTE information for Camera001-POS-INTERP node:
[from TIMER.fraction_changed to set_fraction
]
[from value_changed to Camera001.set_position
]
-->
<PositionInterpolator DEF='Camera001-POS-INTERP' key='0 0.25 0.5 0.75 1' keyValue='0 2000 3500 0 2000 0 0 2000 -3500 0 2000 0 0 2000 3500'/> |
25 |
<!-- ROUTE information for Camera001-ROT-INTERP node:
[from TIMER.fraction_changed to set_fraction
]
[from value_changed to Camera001.set_orientation
]
-->
<OrientationInterpolator DEF='Camera001-ROT-INTERP' key='0 0.25 0.5 0.75 1' keyValue='1 0 0 -0.523599 0.999990 0.003554 0.002727 -1.309007 0 -0.965926 -0.258819 -3.141593 0.002282 -0.793351 -0.608760 -3.135645 1 -0.000001 -0 -0.523599'/> |
26 | < ROUTE fromNode='TIMER' fromField='fraction_changed' toNode='Camera001-POS-INTERP' toField='set_fraction'/> |
27 | < ROUTE fromNode='Camera001-POS-INTERP' fromField='value_changed' toNode='Camera001' toField='set_position'/> |
28 | < ROUTE fromNode='TIMER' fromField='fraction_changed' toNode='Camera001-ROT-INTERP' toField='set_fraction'/> |
29 | < ROUTE fromNode='Camera001-ROT-INTERP' fromField='value_changed' toNode='Camera001' toField='set_orientation'/> |
30 | <Transform DEF='Floor' translation='1.241 0.000 0.358'> |
31 | <Shape> |
32 | <Appearance DEF='WireColor'> |
33 | <Material diffuseColor='0.122 0.114 0.125'/> |
34 | </Appearance> |
35 | <Box size='2000 1 2000'/> |
36 | </Shape> |
37 | </Transform> |
38 | <Transform DEF='TransformAudio1' translation='-933.123474 0 -926.253235'> |
39 | <Shape> |
40 | <Appearance DEF='WireColor_1'> |
41 | <Material diffuseColor='0.690196 0.101961 0.101961'/> |
42 | </Appearance> |
43 | <Sphere radius='100'/> |
44 | </Shape> |
45 | <Billboard> |
46 | <Transform DEF='violin' rotation='1 0 0 -0.5' scale='100 100 100' translation='0 100 0'> |
47 | <Shape> |
48 | <Appearance> |
49 | <Material ambientIntensity='0.0933' diffuseColor='1 1 1' shininess='0.51' specularColor='0.46 0.46 0.46'/> |
50 | </Appearance> |
51 | <Text string='"Violin"'> |
52 |
<!-- FontStyle
ModelFontStyle is a DEF node that has 1 USE node: USE_1 --> <FontStyle DEF='ModelFontStyle' family='"Times" "SERIF"' style='BOLD'/> |
53 | </Text> |
54 | </Shape> |
55 | </Transform> |
56 | </Billboard> |
57 | </Transform> |
58 | <Transform DEF='TransformAudio2' translation='933.475586 0 924.423218'> |
59 | <Shape> |
60 | <Appearance DEF='WireColor_2'> |
61 | <Material diffuseColor='0.105882 0.694118 0.580392'/> |
62 | </Appearance> |
63 | <Sphere radius='100'/> |
64 | </Shape> |
65 | <Billboard> |
66 | <Transform DEF='saxophone' rotation='1 0 0 -0.5' scale='100 100 100' translation='0 100 0'> |
67 | <Shape> |
68 | <Appearance> |
69 | <Material ambientIntensity='0.0933' diffuseColor='1 1 1' shininess='0.51' specularColor='0.46 0.46 0.46'/> |
70 | </Appearance> |
71 | <Text string='"Saxophone"'> |
72 | <FontStyle USE='ModelFontStyle'/> |
73 | </Text> |
74 | </Shape> |
75 | </Transform> |
76 | </Billboard> |
77 | </Transform> |
78 | <ListenerPointSource id='ListenerPointSource' trackCurrentView='true'/> |
79 | <StreamAudioDestination id='AudioDestination'> |
80 | <SpatialSound DEF='Audio1' id='SpatialSound1'> |
81 | <Gain id='Gain1'> |
82 | <AudioClip containerField='children' description='Violin' id='AudioClip1' loop='true' url=' "sound/violin.mp3" "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/sound/violin.mp3" '/> |
83 | </Gain> |
84 | </SpatialSound> |
85 | <SpatialSound DEF='Audio2' id='SpatialSound2'> |
86 | <Gain id='Gain2'> |
87 | <AudioClip containerField='children' description='Saxophone' id='AudioClip2' loop='true' url=' "sound/saxophone.mp3" "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/sound/saxophone.mp3" '/> |
88 | </Gain> |
89 | </SpatialSound> |
90 | </StreamAudioDestination> |
91 | </Scene> |
92 | </X3D> |
Event Graph ROUTE Table entries with 4 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.
TIMER
TimeSensor fraction_changed SFFloat |
Camera001-POS-INTERP
PositionInterpolator set_fraction SFFloat |
then
|
Camera001-POS-INTERP
PositionInterpolator value_changed SFVec3f |
Camera001
Viewpoint set_position SFVec3f |
||
TIMER
TimeSensor fraction_changed SFFloat |
Camera001-ROT-INTERP
OrientationInterpolator set_fraction SFFloat |
then
|
Camera001-ROT-INTERP
OrientationInterpolator value_changed SFRotation |
Camera001
Viewpoint set_orientation SFRotation |
<!--
Color legend: X3D terminology
<X3dNode
DEF='idName' field='value'/>
matches XML terminology
<XmlElement
DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement)
(Grey background inside box: inserted documentation)
(Magenta background: X3D Extensibility)
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->