<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "http://www.web3d.org/specifications/x3d-3.3.dtd">
<X3D profile='Immersive' version='3.3 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' http://www.web3d.org/specifications/x3d-3.3.xsd '>
<head>
<meta name='titlecontent='TimeOfDay.x3d'/>
<meta name='creatorcontent='Joe Roth'/>
<meta name='createdcontent='29 December 2000'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='descriptioncontent='Control scene lighting to simulate time of day, and also modify Fog for visibility.'/>
<meta name=' warning content=' Fog affects 3D objects but not background in scene. '/>
<meta name='identifiercontent=' https://savage.nps.edu/Savage/Environment/TimeOfDay/TimeOfDay.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!--

Index for ExternProtoDeclare definition : ClockMechanism

Index for DEF nodes : ampm, ampmswitch, button, clock, ClockMechanism, Foggy, FogSwitch, green, H, Incrementor, Indy, LightAmbient, LightDirection, M, S, SunLight, transparent, VisibilityButton, VisibilityScript

Index for Viewpoint images : Viewpoint_1, Viewpoint_2
-->
<Scene>
<WorldInfo title='TimeOfDay.x3d'/>
<ExternProtoDeclare name='ClockMechanism'
  url=' "ClockMechanismPROTO.x3d#ClockMechanism" "https://savage.nps.edu/Savage/Environment/TimeOfDay/ClockMechanismPROTO.x3d#ClockMechanism" "ClockMechanismPROTO.wrl#ClockMechanism" "https://savage.nps.edu/Savage/Environment/TimeOfDay/ClockMechanismPROTO.wrl#ClockMechanism" "http://www.cgrg.ohio-state.edu/%257Epgerstma/protolib/protolib/ClockMechanism/ClockMechanismPROTO.wrl#ClockMechanism" '>
<field name='set_hourtype='SFInt32accessType='inputOnly'/>
<field name='set_minutetype='SFInt32accessType='inputOnly'/>
<field name='set_secondtype='SFInt32accessType='inputOnly'/>
<field name='autoClocktype='SFBoolaccessType='initializeOnly'/>
<field name='hourtype='SFInt32accessType='initializeOnly'/>
<field name='minutetype='SFInt32accessType='initializeOnly'/>
<field name='secondtype='SFInt32accessType='initializeOnly'/>
<field name='hourHandAxistype='SFVec3faccessType='initializeOnly'/>
<field name='minuteHandAxistype='SFVec3faccessType='initializeOnly'/>
<field name='secondHandAxistype='SFVec3faccessType='initializeOnly'/>
<field name='twentyFourHourstype='SFBoolaccessType='initializeOnly'/>
<field name='hour_changedtype='SFInt32accessType='outputOnly'/>
<field name='minute_changedtype='SFInt32accessType='outputOnly'/>
<field name='second_changedtype='SFInt32accessType='outputOnly'/>
<field name='hourHand_changedtype='SFRotationaccessType='outputOnly'/>
<field name='minuteHand_changedtype='SFRotationaccessType='outputOnly'/>
<field name='secondHand_changedtype='SFRotationaccessType='outputOnly'/>
<field name='hourpercent_changedtype='SFFloataccessType='outputOnly'/>
</ExternProtoDeclare>
<!-- ROUTE information for ClockMechanism node:  [from Incrementor.hour_changed to set_hour ] [from hourHand_changed to H.set_rotation ] [from minuteHand_changed to M.set_rotation ] [from secondHand_changed to S.set_rotation ] [from hourpercent_changed to LightAmbient.set_fraction ] [from hourpercent_changed to LightDirection.set_fraction ] -->
<ProtoInstance name='ClockMechanismDEF='ClockMechanism'/>
<!-- Note headlight turned off in NavigationInfo. Most browsers allow user toggling headlight also. -->
<!-- This NavigationInfo node is bound at runtime and overrides the NavigationInfo headlight setting within the Inlined scene. -->
<Background groundColor='0 0 0skyColor='0 0 0transparency='0'/>
<Background groundAngle='0.1 1.309 1.570796groundColor='0 0 0 0 0.1 0.3 0 0.2 0.5 0 0.3 0.8skyAngle='0.1 0.15 1.309 1.57079skyColor='0.4 0.4 0.1 0.4 0.4 0.1 0 0.1 0.3 0 0.2 0.6 0.8 0.8 0.8transparency='0'
  backUrl=' "urn:web3d:media:textures/panoramas/ocean_3_back.jpg" "../../../Basic/UniversalMediaPanoramas/ocean_3_back.jpg" "https://www.web3d.org/WorkingGroups/media/textures/panoramas/ocean_3_back.jpg" "https://www.web3d.org/x3d/content/examples/Basic/UniversalMediaPanoramas/ocean_3_back.jpg" "http://www.web3dmedia.com/UniversalMedia/textures/panoramas/ocean_3_back.jpg" "http://www.officetowers.com/UniversalMedia/textures/panoramas/ocean_3_back.jpg" "http://geometrek.com/UniversalMedia/textures/panoramas/ocean_3_back.jpg" "http://www.sc.ehu.es/ccwgamoa/UniversalMedia/textures/panoramas/ocean_3_back.jpg" '
  bottomUrl=' "urn:web3d:media:textures/panoramas/ocean_3_bottom.jpg" "../../../Basic/UniversalMediaPanoramas/ocean_3_bottom.jpg" "https://www.web3d.org/WorkingGroups/media/textures/panoramas/ocean_3_bottom.jpg" "https://www.web3d.org/x3d/content/examples/Basic/UniversalMediaPanoramas/ocean_3_bottom.jpg" "http://www.web3dmedia.com/UniversalMedia/textures/panoramas/ocean_3_bottom.jpg" "http://www.officetowers.com/UniversalMedia/textures/panoramas/ocean_3_bottom.jpg" "http://geometrek.com/UniversalMedia/textures/panoramas/ocean_3_bottom.jpg" "http://www.sc.ehu.es/ccwgamoa/UniversalMedia/textures/panoramas/ocean_3_bottom.jpg" '
  frontUrl=' "urn:web3d:media:textures/panoramas/ocean_3_front.jpg" "../../../Basic/UniversalMediaPanoramas/ocean_3_front.jpg" "https://www.web3d.org/WorkingGroups/media/textures/panoramas/ocean_3_front.jpg" "https://www.web3d.org/x3d/content/examples/Basic/UniversalMediaPanoramas/ocean_3_front.jpg" "http://www.web3dmedia.com/UniversalMedia/textures/panoramas/ocean_3_front.jpg" "http://www.officetowers.com/UniversalMedia/textures/panoramas/ocean_3_front.jpg" "http://geometrek.com/UniversalMedia/textures/panoramas/ocean_3_front.jpg" "http://www.sc.ehu.es/ccwgamoa/UniversalMedia/textures/panoramas/ocean_3_front.jpg" '
  leftUrl=' "urn:web3d:media:textures/panoramas/ocean_3_left.jpg" "../../../Basic/UniversalMediaPanoramas/ocean_3_left.jpg" "https://www.web3d.org/WorkingGroups/media/textures/panoramas/ocean_3_left.jpg" "https://www.web3d.org/x3d/content/examples/Basic/UniversalMediaPanoramas/ocean_3_left.jpg" "http://www.web3dmedia.com/UniversalMedia/textures/panoramas/ocean_3_left.jpg" "http://www.officetowers.com/UniversalMedia/textures/panoramas/ocean_3_left.jpg" "http://geometrek.com/UniversalMedia/textures/panoramas/ocean_3_left.jpg" "http://www.sc.ehu.es/ccwgamoa/UniversalMedia/textures/panoramas/ocean_3_left.jpg" '
  rightUrl=' "urn:web3d:media:textures/panoramas/ocean_3_right.jpg" "../../../Basic/UniversalMediaPanoramas/ocean_3_right.jpg" "https://www.web3d.org/WorkingGroups/media/textures/panoramas/ocean_3_right.jpg" "https://www.web3d.org/x3d/content/examples/Basic/UniversalMediaPanoramas/ocean_3_right.jpg" "http://www.web3dmedia.com/UniversalMedia/textures/panoramas/ocean_3_right.jpg" "http://www.officetowers.com/UniversalMedia/textures/panoramas/ocean_3_right.jpg" "http://geometrek.com/UniversalMedia/textures/panoramas/ocean_3_right.jpg" "http://www.sc.ehu.es/ccwgamoa/UniversalMedia/textures/panoramas/ocean_3_right.jpg" '
  topUrl=' "urn:web3d:media:textures/panoramas/ocean_3_top.jpg" "../../../Basic/UniversalMediaPanoramas/ocean_3_top.jpg" "https://www.web3d.org/WorkingGroups/media/textures/panoramas/ocean_3_top.jpg" "https://www.web3d.org/x3d/content/examples/Basic/UniversalMediaPanoramas/ocean_3_top.jpg" "http://www.web3dmedia.com/UniversalMedia/textures/panoramas/ocean_3_top.jpg" "http://www.officetowers.com/UniversalMedia/textures/panoramas/ocean_3_top.jpg" "http://geometrek.com/UniversalMedia/textures/panoramas/ocean_3_top.jpg" "http://www.sc.ehu.es/ccwgamoa/UniversalMedia/textures/panoramas/ocean_3_top.jpg" '/>

<NavigationInfo headlight='false'/>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<!-- ROUTE information for SunLight node:  [from LightDirection.value_changed to set_direction ] [from LightAmbient.value_changed to set_ambientIntensity ] -->
<DirectionalLight DEF='SunLightambientIntensity='0.5color='.25 .25 .25direction='-0.8 -0.2 -0.2'/>
<!-- ROUTE information for LightAmbient node:  [from ClockMechanism.hourpercent_changed to set_fraction ] [from value_changed to SunLight.set_ambientIntensity ] [from value_changed to transparent.set_transparency ] -->
<ScalarInterpolator DEF='LightAmbientkey='0 0.1 0.5 0.9 1keyValue='0.3 0.3 0.7 0.2 0.2'/>
<!-- ROUTE information for LightDirection node:  [from ClockMechanism.hourpercent_changed to set_fraction ] [from value_changed to SunLight.set_direction ] -->
<PositionInterpolator DEF='LightDirectionkey='0 0.1 0.5 0.9 1keyValue='0.8 -0.2 -0.2 0.8 -0.2 -0.2 0 -1 -0.2 -0.8 -0.2 -0.2 -0.8 -0.2 -0.2'/>
<Transform translation='0 5 135bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Viewpoint description='Control Panel'/>
</Transform>
<Transform translation='0 0 100bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Transform rotation='-1 0 0 1.57translation='0 -10 0bboxCenter='0 0 0bboxSize='-1 -1 -1'> </Transform>
<Transform scale='5 5 5translation='-3 10 0bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Inline DEF='clockbboxCenter='0 0 0bboxSize='-1 -1 -1'
  url=' "ClockMechanismExample2.x3d" "https://savage.nps.edu/Savage/Environment/TimeOfDay/ClockMechanismExample2.x3d" "ClockMechanismExample2.wrl" "https://savage.nps.edu/Savage/Environment/TimeOfDay/ClockMechanismExample2.wrl" '/>

<!-- ROUTE information for button node:  [from isActive to Incrementor.set_boolean ] -->
<TouchSensor DEF='buttondescription='click to increment'/>
<!-- ROUTE information for M node:  [from ClockMechanism.minuteHand_changed to set_rotation ] -->
<Transform DEF='MbboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance DEF='green'>
<Material emissiveColor='0 1 0'/>
</Appearance>
<IndexedLineSet coordIndex='0 1 2 3 4 5 6 7 -1 7 8 9 10 11 12 13 14 -1 14 15 16 17 18 19 20 21 0 -1'>
<Coordinate point='-.02 .705 .04 -.019 .711 .04 -.016 .716 .04 -.012 .721 .04 -.006 .723 .04 0 .724 .04 .006 .723 .04 .012 .721 .04 .016 .716 .04 .019 .711 .04 .02 .705 .04 .02 -.005 .04 .019 -.011 .04 .016 -.016 .04 .012 -.021 .04 .006 -.023 .04 0 -.024 .04 -.003 -.023 .04 -.012 -.021 .04 -.016 -.016 .04 -.019 -.011 .04 -.02 -.005 .04'/>
</IndexedLineSet>
</Shape>
</Transform>
<!-- ROUTE information for H node:  [from ClockMechanism.hourHand_changed to set_rotation ] -->
<Transform DEF='HbboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance>
<Material emissiveColor='0 1 0'/>
</Appearance>
<IndexedLineSet coordIndex='0 1 2 3 4 5 6 7 -1 7 8 9 10 11 12 13 14 -1 14 15 16 17 18 19 20 21 0 -1'>
<Coordinate point='-.056 .62 .02 -.053 .637 .02 -.045 .653 .02 -.033 .665 .02 -.017 .673 .02 0 .676 .02 .017 .673 .02 .033 .665 .02 .045 .653 .02 .053 .637 .02 .056 .62 .02 .056 0 .02 .053 -.017 .02 .045 -.033 .02 .033 -.045 .02 .017 -.053 .02 0 -.056 .02 -.017 -.053 .02 -.033 -.045 .02 -.045 -.033 .02 -.053 -.017 .02 -.056 0 .02'/>
</IndexedLineSet>
</Shape>
</Transform>
<!-- ROUTE information for S node:  [from ClockMechanism.secondHand_changed to set_rotation ] -->
<Transform DEF='SbboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance>
<Material emissiveColor='0 1 0'/>
</Appearance>
<IndexedLineSet coordIndex='0 1 2 3 4 5 6 7 -1 7 8 9 10 11 12 13 14 -1 14 15 16 17 18 19 20 21 0 -1'>
<Coordinate point='-.02 .705 .04 -.019 .711 .04 -.016 .716 .04 -.012 .721 .04 -.006 .723 .04 0 .724 .04 .006 .723 .04 .012 .721 .04 .016 .716 .04 .019 .711 .04 .02 .705 .04 .02 -.005 .04 .019 -.011 .04 .016 -.016 .04 .012 -.021 .04 .006 -.023 .04 0 -.024 .04 -.003 -.023 .04 -.012 -.021 .04 -.016 -.016 .04 -.019 -.011 .04 -.02 -.005 .04'/>
</IndexedLineSet>
</Shape>
</Transform>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance>
<Material transparency='1'/>
</Appearance>
<Box size='2 2 2solid='true'/>
</Shape>
</Transform>
<Transform scale='5 5 5translation='5 10 0bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<!-- ROUTE information for ampmswitch node:  [from ampm.whichchoice to whichChoice ] -->
<Switch DEF='ampmswitchwhichChoice='0bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"AM"'>
<FontStyle/>
</Text>
</Shape>
</Group>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"PM"'>
<FontStyle/>
</Text>
</Shape>
</Group>
</Switch>
<!-- ROUTE information for ampm node:  [from Incrementor.twelvebool to set_boolean ] [from whichchoice to ampmswitch.whichChoice ] -->
<Script DEF='ampm'>
<field name='set_booleantype='SFBoolaccessType='inputOnly'/>
<field name='whichchoicetype='SFInt32accessType='outputOnly'/>
<![CDATA[
            
ecmascript:

function set_boolean ( boolean_input, eventTime)
{

        if ( boolean_input== false ) { whichchoice = 0;}

	if ( boolean_input== true ) { whichchoice = 1; }

}

          
]]>
</Script>
<Transform scale='4 1 1translation='-1 2.5 0bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance>
<Material transparency='1'/>
</Appearance>
<Box size='2 2 2solid='true'/>
</Shape>
<!-- ROUTE information for VisibilityButton node:  [from isActive to VisibilityScript.set_boolean ] -->
<TouchSensor DEF='VisibilityButtondescription='click to change'/>
</Transform>
</Transform>
<Transform scale='5 5 5translation='-37 2 0bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"Click on the clock to increment time by one hour."'>
<FontStyle size='.7'/>
</Text>
</Shape>
<Transform translation='0 -1 0bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"Select the word Visibility to change visibility range"'>
<FontStyle size='.7'/>
</Text>
</Shape>
</Transform>
</Transform>
</Transform>
<Transform bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Extrusion crossSection='0 0 0 100 100 100 100 0 0 0solid='falsespine='-50 -50 50 -50 50 50'/>
<Appearance>
<!-- ROUTE information for transparent node:  [from LightAmbient.value_changed to set_transparency ] -->
<Material DEF='transparentdiffuseColor='0 0 0'/>
</Appearance>
</Shape>
</Transform>
<Transform rotation='0 1 0 3.14translation='0 0 -60bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Viewpoint description='outside'/>
</Transform>
<!-- ROUTE information for Incrementor node:  [from button.isActive to set_boolean ] [from twelvebool to ampm.set_boolean ] [from hour_changed to ClockMechanism.set_hour ] -->
<Script DEF='Incrementor'>
<field name='set_booleantype='SFBoolaccessType='inputOnly'/>
<field name='hour_changedtype='SFInt32accessType='outputOnly'/>
<field name='twelvebooltype='SFBoolaccessType='outputOnly'/>
<![CDATA[
        
ecmascript:

function set_boolean ( boolean_input, eventTime)
{
	Browser.print ('boolean_input=' + boolean_input);
	if ( boolean_input == true )
		{ hour_changed = hour_changed + 1;}

        if (hour_changed <= 11){twelvebool = false; }

	if (hour_changed > 11){twelvebool = true; }
	if (hour_changed ==24) {hour_changed = 0;}
}

// separage function needed for set_hour
// hour_changed is an output, it gets set in the function

      
]]>
</Script>
<Transform scale='5 5 5translation='-18 18 100bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<!-- ROUTE information for FogSwitch node:  [from VisibilityScript.whichchoice to whichChoice ] -->
<Switch DEF='FogSwitchwhichChoice='0bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"Visibility Unlimited"'>
<FontStyle/>
</Text>
</Shape>
</Group>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"Visibility 5000 Meters"'>
<FontStyle/>
</Text>
</Shape>
</Group>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"Visibility 2500 Meters"'>
<FontStyle/>
</Text>
</Shape>
</Group>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"Visibility 1000 Meters"'>
<FontStyle/>
</Text>
</Shape>
</Group>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"Visibility 500 Meters"'>
<FontStyle/>
</Text>
</Shape>
</Group>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"Visibility 250 Meters"'>
<FontStyle/>
</Text>
</Shape>
</Group>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"Visibility 100 Meters"'>
<FontStyle/>
</Text>
</Shape>
</Group>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"Visibility 50 Meters"'>
<FontStyle/>
</Text>
</Shape>
</Group>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"Visibility 25 Meters"'>
<FontStyle/>
</Text>
</Shape>
</Group>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"Visibility 10 Meters"'>
<FontStyle/>
</Text>
</Shape>
</Group>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"Visibility 5 Meters"'>
<FontStyle/>
</Text>
</Shape>
</Group>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Appearance USE='green'/>
<Text string='"Visibility 1 Meter"'>
<FontStyle/>
</Text>
</Shape>
</Group>
</Switch>
<!-- ROUTE information for VisibilityScript node:  [from VisibilityButton.isActive to set_boolean ] [from whichchoice to FogSwitch.whichChoice ] [from range to Foggy.visibilityRange ] [from binder to Foggy.set_bind ] -->
<Script DEF='VisibilityScript'>
<field name='set_booleantype='SFBoolaccessType='inputOnly'/>
<field name='whichchoicetype='SFInt32accessType='outputOnly'/>
<field name='rangetype='SFFloataccessType='outputOnly'/>
<field name='bindertype='SFBoolaccessType='outputOnly'/>
<![CDATA[
          
ecmascript:

function set_boolean ( boolean_input, eventTime)
{
binder =true;
if ( boolean_input== false ) { return; }
whichchoice = whichchoice +1;
if ( whichchoice ==12 ) { whichchoice = 0; }
if (whichchoice ==0) {range = 0;}
if (whichchoice ==1) {range = 5000;}
if (whichchoice ==2) {range = 2500;}
if (whichchoice ==3) {range = 1000;}
if (whichchoice ==4) {range = 500;}
if (whichchoice ==5) {range = 250;}
if (whichchoice ==6) {range = 100;}
if (whichchoice ==7) {range = 50;}
if (whichchoice ==8) {range = 25;}
if (whichchoice ==9) {range = 10;}
if (whichchoice ==10) {range = 5;}
if (whichchoice ==11) {range = 1;}
}

        
]]>
</Script>
</Transform>
</Group>
<!-- ROUTE information for Foggy node:  [from VisibilityScript.range to visibilityRange ] [from VisibilityScript.binder to set_bind ] -->
<Fog DEF='Foggycolor='0 0 0fogType='EXPONENTIAL'/>
<!-- The following two routes toggle the twelve Visibility Text Range labels driven by a touch sensor. -->
<ROUTE fromNode='VisibilityButtonfromField='isActivetoNode='VisibilityScripttoField='set_boolean'/>
<ROUTE fromNode='VisibilityScriptfromField='whichchoicetoNode='FogSwitchtoField='whichChoice'/>
<!-- The following two routes change the visibility range on the Fog node through twelve settings. -->
<ROUTE fromNode='VisibilityScriptfromField='rangetoNode='FoggytoField='visibilityRange'/>
<ROUTE fromNode='VisibilityScriptfromField='bindertoNode='FoggytoField='set_bind'/>
<!-- The following two routes changes the am to pm text and vice-versa when the clock strikes twelve. -->
<ROUTE fromNode='IncrementorfromField='twelvebooltoNode='ampmtoField='set_boolean'/>
<ROUTE fromNode='ampmfromField='whichchoicetoNode='ampmswitchtoField='whichChoice'/>
<!-- The following three routes rotate the hour, minute, and second hands. -->
<ROUTE fromNode='ClockMechanismfromField='hourHand_changedtoNode='HtoField='set_rotation'/>
<ROUTE fromNode='ClockMechanismfromField='minuteHand_changedtoNode='MtoField='set_rotation'/>
<ROUTE fromNode='ClockMechanismfromField='secondHand_changedtoNode='StoField='set_rotation'/>
<!-- The following two routes incremnet the clock one hour when the button is pushed. -->
<ROUTE fromNode='buttonfromField='isActivetoNode='IncrementortoField='set_boolean'/>
<ROUTE fromNode='IncrementorfromField='hour_changedtoNode='ClockMechanismtoField='set_hour'/>
<!-- The following five routes have the clock mechanism drive the light direction, light ambient intensity, as well as the transparency of a box around the world which has the effect darkening the background nodes. -->
<ROUTE fromNode='ClockMechanismfromField='hourpercent_changedtoNode='LightAmbienttoField='set_fraction'/>
<ROUTE fromNode='ClockMechanismfromField='hourpercent_changedtoNode='LightDirectiontoField='set_fraction'/>
<ROUTE fromNode='LightDirectionfromField='value_changedtoNode='SunLighttoField='set_direction'/>
<ROUTE fromNode='LightAmbientfromField='value_changedtoNode='SunLighttoField='set_ambientIntensity'/>
<ROUTE fromNode='LightAmbientfromField='value_changedtoNode='transparenttoField='set_transparency'/>
</Scene>
</X3D>
<!--

Index for ExternProtoDeclare definition : ClockMechanism

Index for DEF nodes : ampm, ampmswitch, button, clock, ClockMechanism, Foggy, FogSwitch, green, H, Incrementor, Indy, LightAmbient, LightDirection, M, S, SunLight, transparent, VisibilityButton, VisibilityScript

Index for Viewpoint images : Viewpoint_1, Viewpoint_2
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
    <Prototype name='ProtoName'> <field name='fieldName'/> </Prototype> -->

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