<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://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 =' http://www.web3d.org/specifications/x3d-3.0.xsd '>
<head>
<meta name='titlecontent='switchsounds.x3d'/>
<meta name='MovingImagecontent='switch-movie.mpg'/>
<meta name='referencecontent=' http://www.nist.gov/vrml.html '/>
<meta name='referencecontent=' http://www.itl.nist.gov/div897/ctg/vrml/vrml.html '/>
<meta name='creatorcontent=' http://www.itl.nist.gov/div897/ctg/vrml/members.html '/>
<meta name='disclaimercontent=' 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. 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='infocontent=' Correct definition and compliance of this conformance scene is maintained by the X3D Working Group, http://www.web3d.org/working-groups/x3d '/>
<meta name='translatorcontent='Michael Kass NIST, Don Brutzman NPS'/>
<meta name='translatedcontent='21 January 2001'/>
<meta name='modifiedcontent='15 April 2017'/>
<meta name='descriptioncontent='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='identifiercontent=' http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/Sound/switchsounds.x3d '/>
<meta name='generatorcontent='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!-- -->
<Scene>
<Viewpoint description='entry viewposition='0 0 5'/>
<!-- PROX_SENSOR ROUTEs:  [from position_changed to START_TRANS.set_translation ] [from orientation_changed to START_TRANS.set_rotation ] [from position_changed to STOP_TRANS.set_translation ] [from orientation_changed to STOP_TRANS.set_rotation ] -->
<ProximitySensor DEF='PROX_SENSORsize='1000 1000 1000'/>
<Switch DEF='MYSWITCHwhichChoice='-1'>
<Sound>
<!-- MYSOUND ROUTE:  [from isActive to SOUND_SCRIPT.colorPhonograph ] -->
<AudioClip DEF='MYSOUNDdescription='chimesloop='true'
  url=' "chimes.wav" "http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/chimes.wav" '/>
</Sound>
</Switch>
<Transform scale='0.5 0.5 0.5'>
<Transform translation='0 -2 0'>
<Shape>
<Appearance>
<Material DEF='PHONOCOLOR'/>
</Appearance>
<Box size='3 1.5 3'/>
</Shape>
</Transform>
<Transform rotation='1 0 0 -2.5'>
<Shape>
<Appearance>
<Material DEF='HORNCOLOR'/>
</Appearance>
<Extrusion beginCap='falsecreaseAngle='1.57crossSection='1 0 0.92388 0.382683 0.707107 0.707106 0.382684 0.923879 1.26759e-006 1 -0.382682 0.92388 -0.707105 0.707108 -0.923879 0.382685 -1 2.53518e-006 -0.923881 -0.382681 -0.707109 -0.707105 -0.382687 -0.923878 -3.80277e-006 -1 0.38268 -0.923881 0.707104 -0.70711 0.923878 -0.382688 1 0endCap='falseorientation='0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0scale='2.2 2.2 1.8 1.8 1.4 1.4 1.2 1.2 1 1 0.8 0.8 0.6 0.6 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.2 0.2 0.0001 0.0001solid='falsespine='0 -1.4 0 0 -1.22137 0 0 -1.01245 0 0 -0.819601 0 0 -0.626754 0 0 -0.401765 0 0 -0.204459 0 0 -0.0164327 0 0 0.176777 0 0 0.380511 0 0 0.578542 0 0 0.819601 0 0 0.996378 0 0 1.8 0 0 1.2 0'/>
</Shape>
</Transform>
</Transform>
<!-- START_TRANS ROUTEs:  [from PROX_SENSOR.position_changed to set_translation ] [from PROX_SENSOR.orientation_changed to set_rotation ] -->
<Transform DEF='START_TRANS'>
<Transform translation='-3 1.5 -5'>
<Shape>
<Appearance>
<!-- GOMATERIAL ROUTE:  [from GOFLASH.value_changed to set_diffuseColor ] -->
<Material DEF='GOMATERIALambientIntensity='1diffuseColor='0 1 0'/>
</Appearance>
<Box DEF='STARTsize='1.3 1 0.1'/>
</Shape>
<Transform translation='-0.45 0 0.2'>
<Shape>
<Appearance>
<Material ambientIntensity='1diffuseColor='0 0 0'/>
</Appearance>
<Text string='"Switch" "in"'>
<FontStyle size='0.4'/>
</Text>
</Shape>
</Transform>
</Transform>
<!-- TOUCHSTART ROUTEs:  [from touchTime to SOUND_SCRIPT.switchIn ] [from touchTime to GOTIMER.set_startTime ] -->
<TouchSensor DEF='TOUCHSTARTdescription='touch to start'/>
<!-- GOTIMER ROUTEs:  [from TOUCHSTART.touchTime to set_startTime ] [from fraction_changed to GOFLASH.set_fraction ] -->
<TimeSensor DEF='GOTIMER'/>
<!-- GOFLASH ROUTEs:  [from GOTIMER.fraction_changed to set_fraction ] [from value_changed to GOMATERIAL.set_diffuseColor ] -->
<ColorInterpolator DEF='GOFLASHkey='0 0.5 1keyValue='0 1 0 1 1 1 0 1 0'/>
</Transform>
<!-- STOP_TRANS ROUTEs:  [from PROX_SENSOR.position_changed to set_translation ] [from PROX_SENSOR.orientation_changed to set_rotation ] -->
<Transform DEF='STOP_TRANS'>
<Transform translation='3 1.5 -5'>
<Shape>
<Appearance>
<!-- STOPMATERIAL ROUTE:  [from STOPFLASH.value_changed to set_diffuseColor ] -->
<Material DEF='STOPMATERIALambientIntensity='1diffuseColor='1 0 0'/>
</Appearance>
<Box DEF='STOPsize='1.3 1 0.1'/>
</Shape>
<Transform translation='-0.65 0 0.2'>
<Shape>
<Appearance>
<Material ambientIntensity='1diffuseColor='0 0 0'/>
</Appearance>
<Text string='"Switch" "out"'>
<FontStyle size='0.4'/>
</Text>
</Shape>
</Transform>
</Transform>
<!-- TOUCHSTOP ROUTEs:  [from touchTime to SOUND_SCRIPT.switchOut ] [from touchTime to STOPTIMER.set_startTime ] -->
<TouchSensor DEF='TOUCHSTOPdescription='touch to stop'/>
<!-- STOPTIMER ROUTEs:  [from TOUCHSTOP.touchTime to set_startTime ] [from fraction_changed to STOPFLASH.set_fraction ] -->
<TimeSensor DEF='STOPTIMER'/>
<!-- STOPFLASH ROUTEs:  [from STOPTIMER.fraction_changed to set_fraction ] [from value_changed to STOPMATERIAL.set_diffuseColor ] -->
<ColorInterpolator DEF='STOPFLASHkey='0 0.5 1keyValue='1 0 0 1 1 1 1 0 0'/>
</Transform>
<!-- SOUND_SCRIPT ROUTEs:  [from TOUCHSTART.touchTime to switchIn ] [from TOUCHSTOP.touchTime to switchOut ] [from MYSOUND.isActive to colorPhonograph ] -->
<Script DEF='SOUND_SCRIPTdirectOutput='true'
  url=' "switch.js" "http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/Sound/switch.js" '>
<field name='mySwitchtype='SFNodeaccessType='initializeOnly'>
<Switch USE='MYSWITCHwhichChoice='-1'/>
</field>
<field name='phonoColortype='SFNodeaccessType='initializeOnly'>
<Material USE='PHONOCOLOR'/>
</field>
<field name='hornColortype='SFNodeaccessType='initializeOnly'>
<Material USE='HORNCOLOR'/>
</field>
<field name='yellowtype='SFColorvalue='0.75 0.75 0.00accessType='initializeOnly'/>
<field name='whitetype='SFColorvalue='0.80 0.80 0.80accessType='initializeOnly'/>
<field name='colorPhonographtype='SFBoolaccessType='inputOnly'/>
<field name='switchIntype='SFTimeaccessType='inputOnly'/>
<field name='switchOuttype='SFTimeaccessType='inputOnly'/>
</Script>
<ROUTE fromNode='TOUCHSTARTfromField='touchTimetoNode='SOUND_SCRIPTtoField='switchIn'/>
<ROUTE fromNode='TOUCHSTOPfromField='touchTimetoNode='SOUND_SCRIPTtoField='switchOut'/>
<ROUTE fromNode='PROX_SENSORfromField='position_changedtoNode='START_TRANStoField='set_translation'/>
<ROUTE fromNode='PROX_SENSORfromField='orientation_changedtoNode='START_TRANStoField='set_rotation'/>
<ROUTE fromNode='PROX_SENSORfromField='position_changedtoNode='STOP_TRANStoField='set_translation'/>
<ROUTE fromNode='PROX_SENSORfromField='orientation_changedtoNode='STOP_TRANStoField='set_rotation'/>
<ROUTE fromNode='MYSOUNDfromField='isActivetoNode='SOUND_SCRIPTtoField='colorPhonograph'/>
<ROUTE fromNode='TOUCHSTARTfromField='touchTimetoNode='GOTIMERtoField='set_startTime'/>
<ROUTE fromNode='GOTIMERfromField='fraction_changedtoNode='GOFLASHtoField='set_fraction'/>
<ROUTE fromNode='GOFLASHfromField='value_changedtoNode='GOMATERIALtoField='set_diffuseColor'/>
<ROUTE fromNode='TOUCHSTOPfromField='touchTimetoNode='STOPTIMERtoField='set_startTime'/>
<ROUTE fromNode='STOPTIMERfromField='fraction_changedtoNode='STOPFLASHtoField='set_fraction'/>
<ROUTE fromNode='STOPFLASHfromField='value_changedtoNode='STOPMATERIALtoField='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

Index for Viewpoint image : Viewpoint_1
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/> -->

<!-- Additional help information about X3D scenes: X3D Resources, X3D Scene Authoring Hints and X3D Tooltips -->