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='BooleanSequencerIntegerSequencer.x3d'/> |
6 | <meta name='description' content='Show synchronized use of BooleanSequencer and IntegerSequencer nodes for SpotLight enabled and Switch whichChoice control, respectively'/> |
7 | <meta name='creator' content='Don Brutzman'/> |
8 | <meta name='created' content='6 September 2006'/> |
9 | <meta name='modified' content='20 October 2019'/> |
10 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/BooleanSequencerIntegerSequencer.x3d'/> |
11 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
12 | <meta name='license' content='../license.html'/> |
13 | </head> |
14 | <Scene> |
15 | <WorldInfo title='BooleanSequencerIntegerSequencer.x3d'/> |
16 | <NavigationInfo/> |
17 |
<!-- ROUTE information for Clock node:
[from fraction_changed to OnOffSequencer.set_fraction
]
[from fraction_changed to ChildSequencer.set_fraction
]
-->
<TimeSensor DEF='Clock' cycleInterval='10' loop='true'/> |
18 |
<!-- ROUTE information for OnOffSequencer node:
[from Clock.fraction_changed to set_fraction
]
[from value_changed to RedSpotLight.on
]
-->
<BooleanSequencer DEF='OnOffSequencer' key='0 0.2 0.4 0.6 0.8 1' keyValue='true false true false true true'/> |
19 |
<!-- ROUTE information for RedSpotLight node:
[from OnOffSequencer.value_changed to on
]
-->
<SpotLight DEF='RedSpotLight' color='1 0.0 0.0' location='0 0 10'/> |
20 | <!-- Note no red or pink materials, only grey --> |
21 | < ROUTE fromNode='Clock' fromField='fraction_changed' toNode='OnOffSequencer' toField='set_fraction'/> |
22 | < ROUTE fromNode='OnOffSequencer' fromField='value_changed' toNode='RedSpotLight' toField='on'/> |
23 |
<!-- ROUTE information for ChildSequencer node:
[from Clock.fraction_changed to set_fraction
]
[from value_changed to ShapeSwitcher.whichChoice
]
-->
<IntegerSequencer DEF='ChildSequencer' key='0 0.2 0.4 0.6 0.8 1' keyValue='0 1 2 3 -1 0'/> |
24 | <Transform translation='-3.5 1 0'> |
25 |
<!-- ROUTE information for ShapeSwitcher node:
[from ChildSequencer.value_changed to whichChoice
]
-->
<Switch DEF='ShapeSwitcher' whichChoice='-1'> |
26 | <Shape DEF='Child0'> |
27 | <Text string='"Grey child 0" "headlight plus red light"'/> |
28 |
<!-- Appearance
GreyAppearance is a DEF node that has 3 USE nodes: USE_1, USE_2, USE_3 -->
<Appearance DEF='GreyAppearance'> |
29 | <Material diffuseColor='0.7 0.7 0.7'/> |
30 | </Appearance> |
31 | </Shape> |
32 | <Shape DEF='Child1'> |
33 | <Text string='"Grey child 1" "headlight only"'/> |
34 | <Appearance USE='GreyAppearance'/> |
35 | </Shape> |
36 | <Shape DEF='Child2'> |
37 | <Text string='"Grey child 2" "headlight plus red light"'/> |
38 | <Appearance USE='GreyAppearance'/> |
39 | </Shape> |
40 | <Shape DEF='Child3'> |
41 | <Text string='"Grey child 3" "headlight only"'/> |
42 | <Appearance USE='GreyAppearance'/> |
43 | </Shape> |
44 | </Switch> |
45 | </Transform> |
46 | < ROUTE fromNode='Clock' fromField='fraction_changed' toNode='ChildSequencer' toField='set_fraction'/> |
47 | < ROUTE fromNode='ChildSequencer' fromField='value_changed' toNode='ShapeSwitcher' toField='whichChoice'/> |
48 | </Scene> |
49 | </X3D> |
Event Graph ROUTE Table with 4 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.
Clock
TimeSensor fraction_changed SFFloat |
OnOffSequencer
BooleanSequencer set_fraction SFFloat |
then
|
OnOffSequencer
BooleanSequencer value_changed SFBool |
RedSpotLight
SpotLight on SFBool |
||
Clock
TimeSensor fraction_changed SFFloat |
ChildSequencer
IntegerSequencer set_fraction SFFloat |
then
|
ChildSequencer
IntegerSequencer value_changed SFInt32 |
ShapeSwitcher
Switch whichChoice SFInt32 |
<!--
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. -->