X3D Model Documentation: BooleanSequencerIntegerSequencer.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='https://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'>
  4       <head>
  5            <meta name='titlecontent=' BooleanSequencerIntegerSequencer.x3d '/>
  6            <meta name='descriptioncontent='Show synchronized use of BooleanSequencer and IntegerSequencer nodes for SpotLight enabled and Switch whichChoice control, respectively'/>
  7            <meta name='creatorcontent='Don Brutzman'/>
  8            <meta name='createdcontent='6 September 2006'/>
  9            <meta name='modifiedcontent='20 October 2019'/>
 10            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/BooleanSequencerIntegerSequencer.x3d '/>
 11            <meta name='generatorcontent='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 12            <meta name='licensecontent='../license.html'/>
 13       </head>
<!--

Event Graph ROUTE Table shows event connections.

--> <!-- to top DEF nodes index: Child0, Child1, Child2, Child3, ChildSequencer, Clock, GreyAppearance, OnOffSequencer, RedSpotLight, ShapeSwitcher

-->
 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='ClockcycleInterval='10loop='trueenabled='true'/>
 18 
          <!-- ROUTE information for OnOffSequencer node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to RedSpotLight.on ] -->
          <BooleanSequencer DEF='OnOffSequencerkey='0 0.2 0.4 0.6 0.8 1keyValue='true false true false true true'/>
 19 
          <!-- ROUTE information for RedSpotLight node:  [from OnOffSequencer.value_changed to on ] -->
          <SpotLight DEF='RedSpotLightcolor='1 0.0 0.0location='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='ChildSequencerkey='0 0.2 0.4 0.6 0.8 1keyValue='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='ShapeSwitcherwhichChoice='-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 shows event connections.

--> <!-- to top DEF nodes index: Child0, Child1, Child2, Child3, ChildSequencer, Clock, GreyAppearance, OnOffSequencer, RedSpotLight, ShapeSwitcher

-->
X3D Tooltips element index: to top Appearance, BooleanSequencer, head, IntegerSequencer, Material, meta, NavigationInfo, ROUTE, Scene, Shape, SpotLight, Switch, Text, TimeSensor, Transform, WorldInfo, X3D,
plus documentation for accessType definitions, type definitions, XML data types, and field types

🔖   Event Graph ROUTE Table entries with 3 ROUTE connections, showing X3D event-model relationships for this scene.

Each row with a ROUTE statement shows an event cascade that may occur during a single timestamp interval between frame renderings, performed as part of the X3D execution model.

Clock
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(1)
OnOffSequencer
BooleanSequencer
set_fraction
SFFloat
then
from
same
node
OnOffSequencer
BooleanSequencer
value_changed
SFBool
→
ROUTE
event to
(2)
RedSpotLight
SpotLight
on
SFBool
Clock
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(1)
ChildSequencer
IntegerSequencer
set_fraction
SFFloat
then
from
same
node
ChildSequencer
IntegerSequencer
value_changed
SFInt32
→
ROUTE
event to
(2)
ShapeSwitcher
Switch
whichChoice
SFInt32


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/X3dForWebAuthors/Chapter09EventUtilitiesScripting/BooleanSequencerIntegerSequencerIndex.html -->
<!-- SourceForge version control Version control at    
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/BooleanSequencerIntegerSequencer.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)
-->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->