| 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='title' content=' TimeOfDay.x3d '/> |
| 6 | <meta name='creator' content='Joe Roth'/> |
| 7 | <meta name='created' content='29 December 2000'/> |
| 8 | <meta name='modified' content='20 October 2019'/> |
| 9 | <meta name='description' content='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='identifier' content=' https://www.web3d.org/x3d/content/examples/Savage/Environment/TimeOfDay/TimeOfDay.x3d '/> |
| 12 | <meta name='generator' content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 13 | <meta name='license' content='../../license.html'/> |
| 14 | </head> |
| 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_hour' type='SFInt32' accessType='inputOnly'/> |
| 19 | <field name='set_minute' type='SFInt32' accessType='inputOnly'/> |
| 20 | <field name='set_second' type='SFInt32' accessType='inputOnly'/> |
| 21 | <field name='autoClock' type='SFBool' accessType='initializeOnly'/> |
| 22 | <field name='hour' type='SFInt32' accessType='initializeOnly'/> |
| 23 | <field name='minute' type='SFInt32' accessType='initializeOnly'/> |
| 24 | <field name='second' type='SFInt32' accessType='initializeOnly'/> |
| 25 | <field name='hourHandAxis' type='SFVec3f' accessType='initializeOnly'/> |
| 26 | <field name='minuteHandAxis' type='SFVec3f' accessType='initializeOnly'/> |
| 27 | <field name='secondHandAxis' type='SFVec3f' accessType='initializeOnly'/> |
| 28 | <field name='twentyFourHours' type='SFBool' accessType='initializeOnly'/> |
| 29 | <field name='hour_changed' type='SFInt32' accessType='outputOnly'/> |
| 30 | <field name='minute_changed' type='SFInt32' accessType='outputOnly'/> |
| 31 | <field name='second_changed' type='SFInt32' accessType='outputOnly'/> |
| 32 | <field name='hourHand_changed' type='SFRotation' accessType='outputOnly'/> |
| 33 | <field name='minuteHand_changed' type='SFRotation' accessType='outputOnly'/> |
| 34 | <field name='secondHand_changed' type='SFRotation' accessType='outputOnly'/> |
| 35 | <field name='hourpercent_changed' type='SFFloat' accessType='outputOnly'/> |
| 36 | </ExternProtoDeclare> |
| 37 |
<!-- 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='ClockMechanism' DEF='ClockMechanism'/> |
| 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.570796' groundColor='0 0 0 0 0.1 0.3 0 0.2 0.5 0 0.3 0.8' skyAngle='0.1 0.15 1.309 1.57079' skyColor='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='SunLight' ambientIntensity='0.5' color='.25 .25 .25' direction='-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='LightAmbient' key='0 0.1 0.5 0.9 1' keyValue='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='LightDirection' key='0 0.1 0.5 0.9 1' keyValue='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.57' translation='0 -10 0'> |
| 52 | <Inline DEF='Indy' bboxCenter='0 1 0' bboxSize='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 5' translation='-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='button' description='click to increment'/> |
| 57 |
<!-- ROUTE information for M node:
[from ClockMechanism.minuteHand_changed to set_rotation
]
-->
<Transform DEF='M'> |
| 58 | <Shape> |
| 59 | |
| 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 5' translation='5 10 0'> |
| 95 |
<!-- ROUTE information for ampmswitch node:
[from ampm.whichchoice to whichChoice
]
-->
<Switch DEF='ampmswitch' whichChoice='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_boolean' type='SFBool' accessType='inputOnly'/> |
| 115 | <field name='whichchoice' type='SFInt32' accessType='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 1' translation='-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='VisibilityButton' description='click to change'/> |
| 126 | </Transform> |
| 127 | </Transform> |
| 128 | <Transform scale='5 5 5' translation='-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 0' solid='false' spine='-50 -50 50 -50 50 50'/> |
| 148 | <Appearance> |
| 149 |
<!-- ROUTE information for transparent node:
[from LightAmbient.value_changed to set_transparency
]
-->
<Material DEF='transparent' diffuseColor='0 0 0'/> |
| 150 | </Appearance> |
| 151 | </Shape> |
| 152 | </Transform> |
| 153 | <Transform rotation='0 1 0 3.14' translation='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_boolean' type='SFBool' accessType='inputOnly'/> |
| 158 | <field name='hour_changed' type='SFInt32' accessType='outputOnly'/> |
| 159 | <field name='twelvebool' type='SFBool' accessType='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 5' translation='-18 18 100'> |
| 163 |
<!-- ROUTE information for FogSwitch node:
[from VisibilityScript.whichchoice to whichChoice
]
-->
<Switch DEF='FogSwitch' whichChoice='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_boolean' type='SFBool' accessType='inputOnly'/> |
| 263 | <field name='whichchoice' type='SFInt32' accessType='outputOnly'/> |
| 264 | <field name='range' type='SFFloat' accessType='outputOnly'/> |
| 265 | <field name='binder' type='SFBool' accessType='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='Foggy' color='0 0 0' fogType='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 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.
|
VisibilityButton
TouchSensor isActive SFBool |
VisibilityScript
Script set_boolean SFBool |
then
|
VisibilityScript
Script binder SFBool |
Foggy
Fog set_bind SFBool |
||
|
then
|
VisibilityScript
Script range SFFloat |
Foggy
Fog visibilityRange SFFloat |
||||
|
then
|
VisibilityScript
Script whichchoice SFInt32 |
FogSwitch
Switch whichChoice SFInt32 |
||||
|
ClockMechanism
ProtoInstance hourHand_changed SFRotation |
H
Transform set_rotation SFRotation |
|||||
|
ClockMechanism
ProtoInstance minuteHand_changed SFRotation |
M
Transform set_rotation SFRotation |
|||||
|
ClockMechanism
ProtoInstance secondHand_changed SFRotation |
S
Transform set_rotation SFRotation |
|||||
|
ClockMechanism
ProtoInstance hourpercent_changed SFFloat |
LightAmbient
ScalarInterpolator set_fraction SFFloat |
then
|
LightAmbient
ScalarInterpolator value_changed SFFloat |
SunLight
DirectionalLight set_ambientIntensity SFFloat |
||
|
then
|
LightAmbient
ScalarInterpolator value_changed SFFloat |
transparent
Material set_transparency SFFloat |
||||
|
ClockMechanism
ProtoInstance hourpercent_changed SFFloat |
LightDirection
PositionInterpolator set_fraction SFFloat |
then
|
LightDirection
PositionInterpolator value_changed SFVec3f |
SunLight
DirectionalLight set_direction SFVec3f |
||
<!--
Color-coding 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)
<ProtoInstance name='ProtoName'>
<field
name='fieldName'/> </ProtoInstance>
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->