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='BackgroundSelector.x3d'/> |
6 | <meta name='description' content='Select one of four Background nodes to show a time-of-day effect.'/> |
7 | <meta name='creator' content='Dale Tourtelotte, Don Brutzman and MV4205 class'/> |
8 | <meta name='created' content='20 April 2009'/> |
9 | <meta name='modified' content='20 October 2019'/> |
10 | <meta name='reference' content='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter11LightingEnvironment/BackgroundColorsOnly.x3d'/> |
11 | <meta name='subject' content='X3D Background example'/> |
12 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter11LightingEnvironmentalEffects/BackgroundSelector.x3d'/> |
13 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
14 | <meta name='license' content='../license.html'/> |
15 | </head> |
16 | <Scene> |
17 | <WorldInfo title='BackgroundSelector.x3d'/> |
18 | <Transform translation='0 3 0'> |
19 | <Shape> |
20 | <Text string='"Background Selector"'> |
21 | <FontStyle justify='"MIDDLE" "MIDDLE"'/> |
22 | </Text> |
23 | <Appearance> |
24 | <Material/> |
25 | </Appearance> |
26 | </Shape> |
27 | </Transform> |
28 |
<!-- ROUTE information for TimeOfDayClock node:
[from fraction_changed to BackgroundSequencer.set_fraction
]
-->
<TimeSensor DEF='TimeOfDayClock' cycleInterval='6' loop='true'/> |
29 |
<!-- ROUTE information for BackgroundSequencer node:
[from TimeOfDayClock.fraction_changed to set_fraction
]
[from value_changed to SelectorScript.whichBackground
]
-->
<IntegerSequencer DEF='BackgroundSequencer' key='0 0.25 0.5 0.75 1' keyValue='0 1 2 3 0'/> |
30 | < ROUTE fromNode='TimeOfDayClock' fromField='fraction_changed' toNode='BackgroundSequencer' toField='set_fraction'/> |
31 |
<!-- ROUTE information for SelectorScript node:
[from BackgroundSequencer.value_changed to whichBackground
]
[from bind0 to SunRiseSky.set_bind
]
[from bind1 to HighNoonSky.set_bind
]
[from bind2 to SunsetSky.set_bind
]
[from bind3 to NightSky.set_bind
]
-->
<Script DEF='SelectorScript'> |
32 | <field name='whichBackground' type='SFInt32' accessType='inputOnly'/> |
33 | <field name='bind0' type='SFBool' accessType='outputOnly'/> |
34 | <field name='bind1' type='SFBool' accessType='outputOnly'/> |
35 | <field name='bind2' type='SFBool' accessType='outputOnly'/> |
36 | <field name='bind3' type='SFBool' accessType='outputOnly'/> |
<![CDATA[
ecmascript: function whichBackground (inputValue) { if (whichBackground == 0) bind0 = true; else if (whichBackground == 1) bind1 = true; else if (whichBackground == 2) bind2 = true; else if (whichBackground == 3) bind3 = true; }
]]>
|
|
38 | </Script> |
39 | < ROUTE fromNode='BackgroundSequencer' fromField='value_changed' toNode='SelectorScript' toField='whichBackground'/> |
40 |
<!-- ROUTE information for SunRiseSky node:
[from SelectorScript.bind0 to set_bind
]
-->
<Background DEF='SunRiseSky' groundAngle='0.75 1.2 1.25 1.26 1.5 1.57' groundColor='0.133333 0.419608 0 0.36 0.1 0 1 0.74 0.4 1 0.74 0.4 0 0 0.5 0 0 0.2 0 0.231373 0.380392' skyAngle='0.5 0.7 1.35 1.45 1.57' skyColor='0 0.035 0.34 0 0.015 0.44 0 0.05 0.5 0 0.1 0.6 0.44 0.8 1 1 1 0.7'/> |
41 |
<!-- ROUTE information for HighNoonSky node:
[from SelectorScript.bind1 to set_bind
]
-->
<Background DEF='HighNoonSky' groundAngle='0.75 1.2 1.25 1.26 1.57' groundColor='0.133333 0.419608 0 0.36 0.1 0 1 0.74 0.4 1 0.74 0.4 0 0.2 0.75 0 0.1 0.5' skyAngle='0.05 0.07 1.57' skyColor='1 1 0.2 1 1 0 0.36 0.63 1 0 0.4 1'/> |
42 |
<!-- ROUTE information for SunsetSky node:
[from SelectorScript.bind2 to set_bind
]
-->
<Background DEF='SunsetSky' groundAngle='0.75 1.2 1.25 1.26 1.57' groundColor='0.133333 0.419608 0 0.36 0.1 0 1 0.74 0.4 1 0.74 0.4 0 0 0.5 0 0 0.2' skyAngle='0.5 0.7 1.2 1.4 1.57' skyColor='0 0 0.38 0 0 0.68 0.5 0.2 1 0.5 0.2 1 1 0.3 0 1 0.2 0.8'/> |
43 |
<!-- ROUTE information for NightSky node:
[from SelectorScript.bind3 to set_bind
]
-->
<Background DEF='NightSky' groundAngle='0.75 1.2 1.25 1.26 1.57' groundColor='0.133333 0.419608 0 0.36 0.1 0 1 0.74 0.4 1 0.74 0.4 0 0 0.5 0 0 0.2' skyAngle='0.03 0.05 1.57' skyColor='1 1 1 0.8 0.8 0.8 0.1 0.1 0.1 0 0 0'/> |
44 | < ROUTE fromNode='SelectorScript' fromField='bind0' toNode='SunRiseSky' toField='set_bind'/> |
45 | < ROUTE fromNode='SelectorScript' fromField='bind1' toNode='HighNoonSky' toField='set_bind'/> |
46 | < ROUTE fromNode='SelectorScript' fromField='bind2' toNode='SunsetSky' toField='set_bind'/> |
47 | < ROUTE fromNode='SelectorScript' fromField='bind3' toNode='NightSky' toField='set_bind'/> |
48 | </Scene> |
49 | </X3D> |
Event Graph ROUTE Table entries with 6 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.
TimeOfDayClock
TimeSensor fraction_changed SFFloat |
BackgroundSequencer
IntegerSequencer set_fraction SFFloat |
then
|
BackgroundSequencer
IntegerSequencer value_changed SFInt32 |
SelectorScript
Script whichBackground SFInt32 |
then
|
SelectorScript
Script bind0 SFBool |
SunRiseSky
Background set_bind SFBool |
|||
then
|
SelectorScript
Script bind1 SFBool |
HighNoonSky
Background set_bind SFBool |
||||||||
then
|
SelectorScript
Script bind2 SFBool |
SunsetSky
Background set_bind SFBool |
||||||||
then
|
SelectorScript
Script bind3 SFBool |
NightSky
Background set_bind SFBool |
<!--
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. -->