X3D Model Documentation: TimeOfDay.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=' TimeOfDay.x3d '/>
  6            <meta name='creatorcontent='Joe Roth'/>
  7            <meta name='createdcontent='29 December 2000'/>
  8            <meta name='modifiedcontent='20 October 2019'/>
  9            <meta name='descriptioncontent='Control scene lighting to simulate time of day, and also modify Fog for visibility.'/>
 10            <meta name=' warning content=' Fog affects 3D objects but not background in scene. '/>
 11            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Savage/Environment/TimeOfDay/TimeOfDay.x3d '/>
 12            <meta name='generatorcontent='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 13            <meta name='licensecontent='../../license.html'/>
 14       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: ampm, ampmswitch, button, clock, ClockMechanism, Foggy, FogSwitch, green, H, Incrementor, Indy, LightAmbient, LightDirection, M, S, SunLight, transparent, VisibilityButton, VisibilityScript

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2

Index for ExternProtoDeclare definition: ClockMechanism
-->
 15       <Scene>
 16            <WorldInfo title='TimeOfDay.x3d'/>
 17            <ExternProtoDeclare name='ClockMechanism'   url=' "ClockMechanismPROTO.x3d#ClockMechanism" "https://www.web3d.org/x3d/content/examples/Savage/Environment/TimeOfDay/ClockMechanismPROTO.x3d#ClockMechanism" "ClockMechanismPROTO.wrl#ClockMechanism" "https://www.web3d.org/x3d/content/examples/Savage/Environment/TimeOfDay/ClockMechanismPROTO.wrl#ClockMechanism" "http://www.cgrg.ohio-state.edu/%257Epgerstma/protolib/protolib/ClockMechanism/ClockMechanismPROTO.wrl#ClockMechanism" '>
 18                 <field name='set_hourtype='SFInt32accessType='inputOnly'/>
 19                 <field name='set_minutetype='SFInt32accessType='inputOnly'/>
 20                 <field name='set_secondtype='SFInt32accessType='inputOnly'/>
 21                 <field name='autoClocktype='SFBoolaccessType='initializeOnly'/>
 22                 <field name='hourtype='SFInt32accessType='initializeOnly'/>
 23                 <field name='minutetype='SFInt32accessType='initializeOnly'/>
 24                 <field name='secondtype='SFInt32accessType='initializeOnly'/>
 25                 <field name='hourHandAxistype='SFVec3faccessType='initializeOnly'/>
 26                 <field name='minuteHandAxistype='SFVec3faccessType='initializeOnly'/>
 27                 <field name='secondHandAxistype='SFVec3faccessType='initializeOnly'/>
 28                 <field name='twentyFourHourstype='SFBoolaccessType='initializeOnly'/>
 29                 <field name='hour_changedtype='SFInt32accessType='outputOnly'/>
 30                 <field name='minute_changedtype='SFInt32accessType='outputOnly'/>
 31                 <field name='second_changedtype='SFInt32accessType='outputOnly'/>
 32                 <field name='hourHand_changedtype='SFRotationaccessType='outputOnly'/>
 33                 <field name='minuteHand_changedtype='SFRotationaccessType='outputOnly'/>
 34                 <field name='secondHand_changedtype='SFRotationaccessType='outputOnly'/>
 35                 <field name='hourpercent_changedtype='SFFloataccessType='outputOnly'/>
 36            </ExternProtoDeclare>
 37 
 38            <!-- Note headlight turned off in NavigationInfo. Most browsers allow user toggling headlight also. -->
 39            <!-- This NavigationInfo node is bound at runtime and overrides the NavigationInfo headlight setting within the Inlined scene. -->
 40            <Background groundColor='0 0 0'/>
 41            <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.8'   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 " '/>
 42            <NavigationInfo headlight='false'/>
 43            <Group>
 44 
               <!-- 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'/>
 45 
               <!-- 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'/>
 46 
               <!-- 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'/>
 47                 <Transform translation='0 5 135'>
 48                      <Viewpoint description='Control Panel'/>
 49                 </Transform>
 50                 <Transform translation='0 0 100'>
 51                      <Transform rotation='-1 0 0 1.57translation='0 -10 0'>
 52                           <Inline DEF='IndybboxCenter='0 1 0bboxSize='6 2 6'   url=' "indy.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Environment/TimeOfDay/indy.x3d" "indy.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Environment/TimeOfDay/indy.wrl" '/>
 53                      </Transform>
 54                      <Transform scale='5 5 5translation='-3 10 0'>
 55                           <Inline DEF='clock'   url=' "ClockMechanismExample2.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Environment/TimeOfDay/ClockMechanismExample2.x3d" "ClockMechanismExample2.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Environment/TimeOfDay/ClockMechanismExample2.wrl" '/>
 56 
                         <!-- ROUTE information for button node:  [from isActive to Incrementor.set_boolean ] -->
                         <TouchSensor DEF='buttondescription='click to increment'/>
 57 
                         <!-- ROUTE information for M node:  [from ClockMechanism.minuteHand_changed to set_rotation ] -->
                         <Transform DEF='M'>
 58                                <Shape>
 59 
                                   <!-- Appearance green is a DEF node that has 16 USE nodes: USE_1, USE_2, USE_3, USE_4, USE_5, USE_6, USE_7, USE_8, USE_9, USE_10, USE_11, USE_12, USE_13, USE_14, USE_15, USE_16 -->
                                   <Appearance DEF='green'>
 60                                          <Material emissiveColor='0 1 0'/>
 61                                     </Appearance>
 62                                     <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'>
 63                                          <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'/>
 64                                     </IndexedLineSet>
 65                                </Shape>
 66                           </Transform>
 67 
                         <!-- ROUTE information for H node:  [from ClockMechanism.hourHand_changed to set_rotation ] -->
                         <Transform DEF='H'>
 68                                <Shape>
 69                                     <Appearance>
 70                                          <Material emissiveColor='0 1 0'/>
 71                                     </Appearance>
 72                                     <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'>
 73                                          <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'/>
 74                                     </IndexedLineSet>
 75                                </Shape>
 76                           </Transform>
 77 
                         <!-- ROUTE information for S node:  [from ClockMechanism.secondHand_changed to set_rotation ] -->
                         <Transform DEF='S'>
 78                                <Shape>
 79                                     <Appearance>
 80                                          <Material emissiveColor='0 1 0'/>
 81                                     </Appearance>
 82                                     <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'>
 83                                          <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'/>
 84                                     </IndexedLineSet>
 85                                </Shape>
 86                           </Transform>
 87                           <Shape>
 88                                <Appearance>
 89                                     <Material transparency='1'/>
 90                                </Appearance>
 91                                <Box/>
 92                           </Shape>
 93                      </Transform>
 94                      <Transform scale='5 5 5translation='5 10 0'>
 95 
                         <!-- ROUTE information for ampmswitch node:  [from ampm.whichchoice to whichChoice ] -->
                         <Switch DEF='ampmswitchwhichChoice='0'>
 96                                <Group>
 97                                     <Shape>
 98                                          <Appearance USE='green'/>
 99                                          <Text string='"AM"'>
100                                               <FontStyle/>
101                                          </Text>
102                                     </Shape>
103                                </Group>
104                                <Group>
105                                     <Shape>
106                                          <Appearance USE='green'/>
107                                          <Text string='"PM"'>
108                                               <FontStyle/>
109                                          </Text>
110                                     </Shape>
111                                </Group>
112                           </Switch>
113 
                         <!-- ROUTE information for ampm node:  [from Incrementor.twelvebool to set_boolean ] [from whichchoice to ampmswitch.whichChoice ] -->
                         <Script DEF='ampm'>
114                                <field name='set_booleantype='SFBoolaccessType='inputOnly'/>
115                                <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; }

}

          
]]>
117                           </Script>
118                           <Transform scale='4 1 1translation='-1 2.5 0'>
119                                <Shape>
120                                     <Appearance>
121                                          <Material transparency='1'/>
122                                     </Appearance>
123                                     <Box/>
124                                </Shape>
125 
                              <!-- ROUTE information for VisibilityButton node:  [from isActive to VisibilityScript.set_boolean ] -->
                              <TouchSensor DEF='VisibilityButtondescription='click to change'/>
126                           </Transform>
127                      </Transform>
128                      <Transform scale='5 5 5translation='-37 2 0'>
129                           <Shape>
130                                <Appearance USE='green'/>
131                                <Text string='"Click on the clock to increment time by one hour."'>
132                                     <FontStyle size='.7'/>
133                                </Text>
134                           </Shape>
135                           <Transform translation='0 -1 0'>
136                                <Shape>
137                                     <Appearance USE='green'/>
138                                     <Text string='"Select the word Visibility to change visibility range"'>
139                                          <FontStyle size='.7'/>
140                                     </Text>
141                                </Shape>
142                           </Transform>
143                      </Transform>
144                 </Transform>
145                 <Transform>
146                      <Shape>
147                           <Extrusion crossSection='0 0 0 100 100 100 100 0 0 0solid='falsespine='-50 -50 50 -50 50 50'/>
148                           <Appearance>
149 
                              <!-- ROUTE information for transparent node:  [from LightAmbient.value_changed to set_transparency ] -->
                              <Material DEF='transparentdiffuseColor='0 0 0'/>
150                           </Appearance>
151                      </Shape>
152                 </Transform>
153                 <Transform rotation='0 1 0 3.14translation='0 0 -60'>
154                      <Viewpoint description='outside'/>
155                 </Transform>
156 
               <!-- 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'>
157                      <field name='set_booleantype='SFBoolaccessType='inputOnly'/>
158                      <field name='hour_changedtype='SFInt32accessType='outputOnly'/>
159                      <field name='twelvebooltype='SFBoolaccessType='outputOnly'/>
  <![CDATA[
        
ecmascript:

function set_boolean ( boolean_input, eventTime)
{
	Browser.println ('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

      
]]>
161                 </Script>
162                 <Transform scale='5 5 5translation='-18 18 100'>
163 
                    <!-- ROUTE information for FogSwitch node:  [from VisibilityScript.whichchoice to whichChoice ] -->
                    <Switch DEF='FogSwitchwhichChoice='0'>
164                           <Group>
165                                <Shape>
166                                     <Appearance USE='green'/>
167                                     <Text string='"Visibility Unlimited"'>
168                                          <FontStyle/>
169                                     </Text>
170                                </Shape>
171                           </Group>
172                           <Group>
173                                <Shape>
174                                     <Appearance USE='green'/>
175                                     <Text string='"Visibility 5000 Meters"'>
176                                          <FontStyle/>
177                                     </Text>
178                                </Shape>
179                           </Group>
180                           <Group>
181                                <Shape>
182                                     <Appearance USE='green'/>
183                                     <Text string='"Visibility 2500 Meters"'>
184                                          <FontStyle/>
185                                     </Text>
186                                </Shape>
187                           </Group>
188                           <Group>
189                                <Shape>
190                                     <Appearance USE='green'/>
191                                     <Text string='"Visibility 1000 Meters"'>
192                                          <FontStyle/>
193                                     </Text>
194                                </Shape>
195                           </Group>
196                           <Group>
197                                <Shape>
198                                     <Appearance USE='green'/>
199                                     <Text string='"Visibility 500 Meters"'>
200                                          <FontStyle/>
201                                     </Text>
202                                </Shape>
203                           </Group>
204                           <Group>
205                                <Shape>
206                                     <Appearance USE='green'/>
207                                     <Text string='"Visibility 250 Meters"'>
208                                          <FontStyle/>
209                                     </Text>
210                                </Shape>
211                           </Group>
212                           <Group>
213                                <Shape>
214                                     <Appearance USE='green'/>
215                                     <Text string='"Visibility 100 Meters"'>
216                                          <FontStyle/>
217                                     </Text>
218                                </Shape>
219                           </Group>
220                           <Group>
221                                <Shape>
222                                     <Appearance USE='green'/>
223                                     <Text string='"Visibility 50 Meters"'>
224                                          <FontStyle/>
225                                     </Text>
226                                </Shape>
227                           </Group>
228                           <Group>
229                                <Shape>
230                                     <Appearance USE='green'/>
231                                     <Text string='"Visibility 25 Meters"'>
232                                          <FontStyle/>
233                                     </Text>
234                                </Shape>
235                           </Group>
236                           <Group>
237                                <Shape>
238                                     <Appearance USE='green'/>
239                                     <Text string='"Visibility 10 Meters"'>
240                                          <FontStyle/>
241                                     </Text>
242                                </Shape>
243                           </Group>
244                           <Group>
245                                <Shape>
246                                     <Appearance USE='green'/>
247                                     <Text string='"Visibility 5 Meters"'>
248                                          <FontStyle/>
249                                     </Text>
250                                </Shape>
251                           </Group>
252                           <Group>
253                                <Shape>
254                                     <Appearance USE='green'/>
255                                     <Text string='"Visibility 1 Meter"'>
256                                          <FontStyle/>
257                                     </Text>
258                                </Shape>
259                           </Group>
260                      </Switch>
261 
                    <!-- 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'>
262                           <field name='set_booleantype='SFBoolaccessType='inputOnly'/>
263                           <field name='whichchoicetype='SFInt32accessType='outputOnly'/>
264                           <field name='rangetype='SFFloataccessType='outputOnly'/>
265                           <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;}
}

        
]]>
267                      </Script>
268                 </Transform>
269            </Group>
270 
          <!-- ROUTE information for Foggy node:  [from VisibilityScript.range to visibilityRange ] [from VisibilityScript.binder to set_bind ] -->
          <Fog DEF='Foggycolor='0 0 0fogType='EXPONENTIAL'/>
271            <!-- The following two routes toggle the twelve Visibility Text Range labels driven by a touch sensor. -->
272            < ROUTE  fromNode='VisibilityButton' fromField='isActive' toNode='VisibilityScript' toField='set_boolean'/>
273            < ROUTE  fromNode='VisibilityScript' fromField='whichchoice' toNode='FogSwitch' toField='whichChoice'/>
274            <!-- The following two routes change the visibility range on the Fog node through twelve settings. -->
275            < ROUTE  fromNode='VisibilityScript' fromField='range' toNode='Foggy' toField='visibilityRange'/>
276            < ROUTE  fromNode='VisibilityScript' fromField='binder' toNode='Foggy' toField='set_bind'/>
277            <!-- The following two routes changes the am to pm text and vice-versa when the clock strikes twelve. -->
278            < ROUTE  fromNode='Incrementor' fromField='twelvebool' toNode='ampm' toField='set_boolean'/>
279            < ROUTE  fromNode='ampm' fromField='whichchoice' toNode='ampmswitch' toField='whichChoice'/>
280            <!-- The following three routes rotate the hour, minute, and second hands. -->
281            < ROUTE  fromNode='ClockMechanism' fromField='hourHand_changed' toNode='H' toField='set_rotation'/>
282            < ROUTE  fromNode='ClockMechanism' fromField='minuteHand_changed' toNode='M' toField='set_rotation'/>
283            < ROUTE  fromNode='ClockMechanism' fromField='secondHand_changed' toNode='S' toField='set_rotation'/>
284            <!-- The following two routes incremnet the clock one hour when the button is pushed. -->
285            < ROUTE  fromNode='button' fromField='isActive' toNode='Incrementor' toField='set_boolean'/>
286            < ROUTE  fromNode='Incrementor' fromField='hour_changed' toNode='ClockMechanism' toField='set_hour'/>
287            <!-- 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. -->
288            < ROUTE  fromNode='ClockMechanism' fromField='hourpercent_changed' toNode='LightAmbient' toField='set_fraction'/>
289            < ROUTE  fromNode='ClockMechanism' fromField='hourpercent_changed' toNode='LightDirection' toField='set_fraction'/>
290            < ROUTE  fromNode='LightDirection' fromField='value_changed' toNode='SunLight' toField='set_direction'/>
291            < ROUTE  fromNode='LightAmbient' fromField='value_changed' toNode='SunLight' toField='set_ambientIntensity'/>
292            < ROUTE  fromNode='LightAmbient' fromField='value_changed' toNode='transparent' toField='set_transparency'/>
293       </Scene>
294  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: ampm, ampmswitch, button, clock, ClockMechanism, Foggy, FogSwitch, green, H, Incrementor, Indy, LightAmbient, LightDirection, M, S, SunLight, transparent, VisibilityButton, VisibilityScript

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2

Index for ExternProtoDeclare definition: ClockMechanism
-->
X3D Tooltips element index: Appearance, Background, Box, Coordinate, DirectionalLight, ExternProtoDeclare, Extrusion, field, Fog, FontStyle, Group, head, IndexedLineSet, Inline, Material, meta, NavigationInfo, PositionInterpolator, ProtoInstance, ROUTE, ScalarInterpolator, Scene, Script, Shape, Switch, Text, TouchSensor, Transform, Viewpoint, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

Event Graph ROUTE Table entries with 16 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.

button
TouchSensor
isActive
SFBool

ROUTE
event to
(1)
Incrementor
Script
set_boolean
SFBool
then
 
 
 
Incrementor
Script
hour_changed
SFInt32

ROUTE
event to
(2)
ClockMechanism
ProtoInstance
set_hour
SFInt32
then
 
 
 
ClockMechanism
ProtoInstance
hourHand_changed
SFRotation

ROUTE
event to
(3)
H
Transform
set_rotation
SFRotation
  then
 
 
 
ClockMechanism
ProtoInstance
hourpercent_changed
SFFloat

ROUTE
event to
(3)
LightAmbient
ScalarInterpolator
set_fraction
SFFloat
then
 
 
 
LightAmbient
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(4)
SunLight
DirectionalLight
set_ambientIntensity
SFFloat
  then
 
 
 
LightAmbient
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(4)
transparent
Material
set_transparency
SFFloat
  then
 
 
 
ClockMechanism
ProtoInstance
hourpercent_changed
SFFloat

ROUTE
event to
(3)
LightDirection
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
LightDirection
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(4)
SunLight
DirectionalLight
set_direction
SFVec3f
  then
 
 
 
ClockMechanism
ProtoInstance
minuteHand_changed
SFRotation

ROUTE
event to
(3)
M
Transform
set_rotation
SFRotation
  then
 
 
 
ClockMechanism
ProtoInstance
secondHand_changed
SFRotation

ROUTE
event to
(3)
S
Transform
set_rotation
SFRotation
  then
 
 
 
Incrementor
Script
twelvebool
SFBool

ROUTE
event to
(2)
ampm
Script
set_boolean
SFBool
then
 
 
 
ampm
Script
whichchoice
SFInt32

ROUTE
event to
(3)
ampmswitch
Switch
whichChoice
SFInt32

VisibilityButton
TouchSensor
isActive
SFBool

ROUTE
event to
(1)
VisibilityScript
Script
set_boolean
SFBool
then
 
 
 
VisibilityScript
Script
binder
SFBool

ROUTE
event to
(2)
Foggy
Fog
set_bind
SFBool
  then
 
 
 
VisibilityScript
Script
range
SFFloat

ROUTE
event to
(2)
Foggy
Fog
visibilityRange
SFFloat
  then
 
 
 
VisibilityScript
Script
whichchoice
SFInt32

ROUTE
event to
(2)
FogSwitch
Switch
whichChoice
SFInt32

      ClockMechanism
ProtoInstance
hourHand_changed
SFRotation

ROUTE
event to
(1)
H
Transform
set_rotation
SFRotation
ClockMechanism
ProtoInstance
minuteHand_changed
SFRotation

ROUTE
event to
(1)
M
Transform
set_rotation
SFRotation
ClockMechanism
ProtoInstance
secondHand_changed
SFRotation

ROUTE
event to
(1)
S
Transform
set_rotation
SFRotation
ClockMechanism
ProtoInstance
hourpercent_changed
SFFloat

ROUTE
event to
(1)
LightAmbient
ScalarInterpolator
set_fraction
SFFloat
then
 
 
 
LightAmbient
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(2)
SunLight
DirectionalLight
set_ambientIntensity
SFFloat
  then
 
 
 
LightAmbient
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(2)
transparent
Material
set_transparency
SFFloat
ClockMechanism
ProtoInstance
hourpercent_changed
SFFloat

ROUTE
event to
(1)
LightDirection
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
LightDirection
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(2)
SunLight
DirectionalLight
set_direction
SFVec3f

Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/Savage/Environment/TimeOfDay/TimeOfDayIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/Environment/TimeOfDay/TimeOfDay.x3d -->

<!-- Color-coding 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. -->