<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Immersive'
version='3.0'
xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance'
xsd:noNamespaceSchemaLocation
='
https://www.web3d.org/specifications/x3d-3.0.xsd
'
>
<head>
<meta name='title' content='switchsounds.x3d'/>
<meta name='MovingImage' content='switch-movie.mpg'/>
<meta name='reference' content='
http://www.nist.gov/vrml.html
'/>
<meta name='reference' content='
http://www.itl.nist.gov/div897/ctg/vrml/vrml.html
'/>
<meta name='creator' content='
http://www.itl.nist.gov/div897/ctg/vrml/members.html
'/>
<meta name='disclaimer' content='
This file was provided by the National Institute of Standards and Technology, and is part of the X3D Conformance Test Suite, available at http://www.nist.gov/vrml.html
The information contained within this file is provided for use in establishing conformance to the ISO VRML97 Specification. Conformance to this test does not imply recommendation or endorsement by the National Institute of Standards and Technology (NIST). This software can be redistributed and/or modified freely provided that any derivative works bear some notice that they are derived from it, and any modified versions bear some notice that they have been modified. '/>
<meta name='reference' content='
Interactive Conformance Testing for VRML, Mary Brady and Lynn Rosenthal, NIST, created 8 September 2010 and updated 25 August 2016, https://www.nist.gov/itl/ssd/information-systems-group/interactive-conformance-testing-vrml
'/>
<meta name='info' content='Correct definition and compliance of this conformance scene is maintained by the X3D Working Group, https://www.web3d.org/working-groups/x3d'/>
<meta name='translator' content='Michael Kass NIST, Don Brutzman NPS'/>
<meta name='translated' content='21 January 2001'/>
<meta name='modified' content='2 September 2023'/>
<meta name='description' content='Test Switching of sounds. A "chime" sounding Sound node is initially a "switched out" child of a Switch node in this world. If the viewer clicks on the "Switch in" button in this world, the Sound child is switched in as a child of the Switch node, and should begin to play. If the viewer clicks on the "Switch out" button while the Sound is playing, the sound should cease. However, the Sound node should continue to send and receive events, and as a result, the "phonograph" geometry continue to remain a yellow color, indicating that the Sound node isActive field is still true, even though the Sound is no longer audible.'/>
<meta name='identifier' content='
https://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/Sound/switchsounds.x3d
'/>
<meta name='generator' content='Vrml97ToX3dNist,
http://ovrt.nist.gov/v2_x3d.html'/>
<meta name='generator' content='X3D-Edit 4.0,
https://savage.nps.edu/X3D-Edit'/>
<meta name='license' content='
../../license.html'/>
</head>
<!--
Index for DEF nodes:
GOFLASH,
GOMATERIAL,
GOTIMER,
HORNCOLOR,
MYSOUND,
MYSWITCH,
PHONOCOLOR,
PROX_SENSOR,
SOUND_SCRIPT,
START,
START_TRANS,
STOP,
STOP_TRANS,
STOPFLASH,
STOPMATERIAL,
STOPTIMER,
TOUCHSTART,
TOUCHSTOP and
Event Graph ROUTE Table
Index for Viewpoint node:
Viewpoint_1
-->
<Scene>
<WorldInfo title='switchsounds.x3d'/>
<Viewpoint description='entry view' position='0 0 5'/>
<Switch DEF='MYSWITCH' whichChoice='-1'>
</Switch>
<Transform scale='0.5 0.5 0.5'>
<Transform translation='0 -2 0'>
<Shape>
<Appearance>
</Appearance>
<Box size='3 1.5 3'/>
</Shape>
</Transform>
<Transform rotation='1 0 0 -2.5'>
</Transform>
</Transform>
<Transform translation='-3 1.5 -5'>
<Shape>
<Appearance>
</Appearance>
<Box DEF='START' size='1.3 1 0.1'/>
</Shape>
<Transform translation='-0.45 0 0.2'>
<Shape>
<Appearance>
<Material ambientIntensity='1' diffuseColor='0 0 0'/>
</Appearance>
<Text string='"Switch" "in"'>
<FontStyle size='0.4'/>
</Text>
</Shape>
</Transform>
</Transform>
</Transform>
<Transform translation='3 1.5 -5'>
<Shape>
<Appearance>
</Appearance>
<Box DEF='STOP' size='1.3 1 0.1'/>
</Shape>
<Transform translation='-0.65 0 0.2'>
<Shape>
<Appearance>
<Material ambientIntensity='1' diffuseColor='0 0 0'/>
</Appearance>
<Text string='"Switch" "out"'>
<FontStyle size='0.4'/>
</Text>
</Shape>
</Transform>
</Transform>
</Transform>
<field name='mySwitch' type='SFNode' accessType='initializeOnly'>
</field>
<field name='phonoColor' type='SFNode' accessType='initializeOnly'>
</field>
<field name='hornColor' type='SFNode' accessType='initializeOnly'>
</field>
<field name='yellow' type='SFColor' value='0.75 0.75 0.00' accessType='initializeOnly'/>
<field name='white' type='SFColor' value='0.80 0.80 0.80' accessType='initializeOnly'/>
<field name='colorPhonograph' type='SFBool' accessType='inputOnly'/>
<field name='switchIn' type='SFTime' accessType='inputOnly'/>
<field name='switchOut' type='SFTime' accessType='inputOnly'/>
</Script>
<
ROUTE
fromNode='
TOUCHSTART' fromField='touchTime' toNode='
SOUND_SCRIPT' toField='switchIn'/>
<
ROUTE
fromNode='
TOUCHSTOP' fromField='touchTime' toNode='
SOUND_SCRIPT' toField='switchOut'/>
<
ROUTE
fromNode='
PROX_SENSOR' fromField='position_changed' toNode='
START_TRANS' toField='set_translation'/>
<
ROUTE
fromNode='
PROX_SENSOR' fromField='orientation_changed' toNode='
START_TRANS' toField='set_rotation'/>
<
ROUTE
fromNode='
PROX_SENSOR' fromField='position_changed' toNode='
STOP_TRANS' toField='set_translation'/>
<
ROUTE
fromNode='
PROX_SENSOR' fromField='orientation_changed' toNode='
STOP_TRANS' toField='set_rotation'/>
<
ROUTE
fromNode='
MYSOUND' fromField='isActive' toNode='
SOUND_SCRIPT' toField='colorPhonograph'/>
<
ROUTE
fromNode='
TOUCHSTART' fromField='touchTime' toNode='
GOTIMER' toField='set_startTime'/>
<
ROUTE
fromNode='
GOTIMER' fromField='fraction_changed' toNode='
GOFLASH' toField='set_fraction'/>
<
ROUTE
fromNode='
GOFLASH' fromField='value_changed' toNode='
GOMATERIAL' toField='set_diffuseColor'/>
<
ROUTE
fromNode='
TOUCHSTOP' fromField='touchTime' toNode='
STOPTIMER' toField='set_startTime'/>
<
ROUTE
fromNode='
STOPTIMER' fromField='fraction_changed' toNode='
STOPFLASH' toField='set_fraction'/>
<
ROUTE
fromNode='
STOPFLASH' fromField='value_changed' toNode='
STOPMATERIAL' toField='set_diffuseColor'/>
</Scene>
</X3D>
<!--
Index for DEF nodes:
GOFLASH,
GOMATERIAL,
GOTIMER,
HORNCOLOR,
MYSOUND,
MYSWITCH,
PHONOCOLOR,
PROX_SENSOR,
SOUND_SCRIPT,
START,
START_TRANS,
STOP,
STOP_TRANS,
STOPFLASH,
STOPMATERIAL,
STOPTIMER,
TOUCHSTART,
TOUCHSTOP and
Event Graph ROUTE Table
Index for Viewpoint node:
Viewpoint_1
-->
-->
<!--
Online at
https://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/Sound/switchsoundsIndex.html
-->
<!--
Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/Sound/switchsounds.x3d
-->
<!--
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.
-->