X3D Model Documentation: BooleanSequencerExample.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2 
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
  3  <X3D profile='Immersive' version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  4       <head>
  5            <meta name='titlecontent='BooleanSequencerExample.x3d'/>
  6            <meta name='descriptioncontent='This example shows how to use the BooleanSequencer prototype in an animated scenario.'/>
  7            <meta name='creatorcontent='Don Brutzman, Estuko Lippi, Jeff Weekley, Jane Wu'/>
  8            <meta name='createdcontent='10 August 2001'/>
  9            <meta name='modifiedcontent='20 October 2019'/>
 10            <meta name='referencecontent='https://www.web3d.org/technicalinfo/specifications/vrml97/part1/nodesRef.html#ScalarInterpolator'/>
 11            <meta name='subjectcontent='boolean sequencer'/>
 12            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Basic/development/BooleanSequencerExample.x3d'/>
 13            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 14            <meta name='licensecontent='../license.html'/>
 15       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: AnimatedView1, AnimatedView2, AnimatedView3, AnimatedView4, AnimatedView5, AnimatedView6, BackViewBinder, BackViewpoint, BillboardPlaneTransform, BillboardWhereTransform, BottomViewBinder, BottomViewpoint, Clock, Debug, DebugSwitch, FrontDownViewBinder, FrontDownViewpoint, FrontUpViewpoint, HUDGroup, LeftViewBinder, LeftViewpoint, RightViewBinder, RightViewpoint, TopViewBinder, TopViewpoint, Toucher, WhereSensor

Index for Viewpoint nodes: BackViewpoint, BottomViewpoint, FrontDownViewpoint, FrontUpViewpoint, LeftViewpoint, RightViewpoint, TopViewpoint
-->
 16       <Scene>
 17            <WorldInfo title='BooleanSequencerExample.x3d'/>
 18            <Group DEF='HUDGroup'>
 19 
               <!-- ROUTE information for WhereSensor node:  [from position_changed to BillboardWhereTransform.set_translation ] [from orientation_changed to BillboardWhereTransform.set_rotation ] -->
               <ProximitySensor DEF='WhereSensorsize='1000 1000 1000'/>
 20 
               <!-- ROUTE information for BillboardWhereTransform node:  [from WhereSensor.position_changed to set_translation ] [from WhereSensor.orientation_changed to set_rotation ] -->
               <Transform DEF='BillboardWhereTransform'>
 21                      <Transform rotation='1 0 0 -0.03translation='0 0 -12'>
 22                           <Billboard>
 23                                <Transform DEF='BillboardPlaneTransform'>
 24 
                                   <!-- ROUTE information for Toucher node:  [from touchTime to Clock.set_startTime ] -->
                                   <TouchSensor DEF='Toucherdescription='Click text to start clock and run multiple BooleanSequencers'/>
 25                                     <Shape>
 26                                          <Appearance>
 27                                               <Material diffuseColor='0 1 1'/>
 28                                          </Appearance>
 29                                          <Text string='"Click text to start clock, run" "multiple BooleanSequencers" "" "" "" "See Viewpoint description" "for bound Viewpoint number"'>
 30                                               <FontStyle justify='"MIDDLE" "MIDDLE"'/>
 31                                          </Text>
 32                                     </Shape>
 33                                </Transform>
 34                           </Billboard>
 35                      </Transform>
 36                 </Transform>
 37                 < ROUTE  fromNode='WhereSensor' fromField='position_changed' toNode='BillboardWhereTransform' toField='set_translation'/>
 38                 < ROUTE  fromNode='WhereSensor' fromField='orientation_changed' toNode='BillboardWhereTransform' toField='set_rotation'/>
 39            </Group>
 40 
 41            < ROUTE  fromNode='Toucher' fromField='touchTime' toNode='Clock' toField='set_startTime'/>
 42 
          <!-- ROUTE information for FrontUpViewpoint node:  [from isBound to Debug.setFrontUpViewBind ] -->
          <Viewpoint DEF='FrontUpViewpointdescription='View 0, Front Up'/>
 43            <Group DEF='AnimatedView1'>
 44 
               <!-- ROUTE information for LeftViewpoint node:  [from LeftViewBinder.value_changed to set_bind ] [from isBound to Debug.setLeftViewBind ] -->
               <Viewpoint DEF='LeftViewpointdescription='View 1, Leftorientation='0 1 0 -1.57position='-10 0 0'/>
 45 
               <!-- ROUTE information for LeftViewBinder node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to LeftViewpoint.set_bind ] [from value_changed to Debug.setLeftBSOutput ] -->
               <BooleanSequencer DEF='LeftViewBinderkey='0 0.1 0.25keyValue='false true false'/>
 46                 < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='LeftViewBinder' toField='set_fraction'/>
 47                 < ROUTE  fromNode='LeftViewBinder' fromField='value_changed' toNode='LeftViewpoint' toField='set_bind'/>
 48            </Group>
 49            <Group DEF='AnimatedView2'>
 50 
               <!-- ROUTE information for BackViewpoint node:  [from BackViewBinder.value_changed to set_bind ] [from isBound to Debug.setBackViewBind ] -->
               <Viewpoint DEF='BackViewpointdescription='View 2, Backorientation='0 1 0 -3.14position='0 0 -10'/>
 51 
               <!-- ROUTE information for BackViewBinder node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to BackViewpoint.set_bind ] [from value_changed to Debug.setBackBSOutput ] -->
               <BooleanSequencer DEF='BackViewBinderkey='0 0.375 0.475keyValue='false true false'/>
 52                 < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='BackViewBinder' toField='set_fraction'/>
 53                 < ROUTE  fromNode='BackViewBinder' fromField='value_changed' toNode='BackViewpoint' toField='set_bind'/>
 54            </Group>
 55            <Group DEF='AnimatedView3'>
 56 
               <!-- ROUTE information for RightViewpoint node:  [from RightViewBinder.value_changed to set_bind ] [from isBound to Debug.setRightViewBind ] -->
               <Viewpoint DEF='RightViewpointdescription='View 3, Rightorientation='0 1 0 1.57position='10 0 0'/>
 57 
               <!-- ROUTE information for RightViewBinder node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to RightViewpoint.set_bind ] [from value_changed to Debug.setRightBSOutput ] -->
               <BooleanSequencer DEF='RightViewBinderkey='0 0.5 0.6keyValue='false true false'/>
 58                 < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='RightViewBinder' toField='set_fraction'/>
 59                 < ROUTE  fromNode='RightViewBinder' fromField='value_changed' toNode='RightViewpoint' toField='set_bind'/>
 60            </Group>
 61            <Group DEF='AnimatedView4'>
 62 
               <!-- ROUTE information for TopViewpoint node:  [from TopViewBinder.value_changed to set_bind ] [from isBound to Debug.setTopViewBind ] -->
               <Viewpoint DEF='TopViewpointdescription='View 4, Toporientation='1 0 0 -1.57position='0 10 0'/>
 63 
               <!-- ROUTE information for TopViewBinder node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to TopViewpoint.set_bind ] [from value_changed to Debug.setTopBSOutput ] -->
               <BooleanSequencer DEF='TopViewBinderkey='0.625 0.725keyValue='true false'/>
 64                 < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='TopViewBinder' toField='set_fraction'/>
 65                 < ROUTE  fromNode='TopViewBinder' fromField='value_changed' toNode='TopViewpoint' toField='set_bind'/>
 66            </Group>
 67            <Group DEF='AnimatedView5'>
 68 
               <!-- ROUTE information for FrontDownViewpoint node:  [from FrontDownViewBinder.value_changed to set_bind ] [from isBound to Debug.setFrontDownViewBind ] -->
               <Viewpoint DEF='FrontDownViewpointdescription='View 5, Front Downorientation='1 0 0 -3.14position='0 0 -10'/>
 69 
               <!-- ROUTE information for FrontDownViewBinder node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to FrontDownViewpoint.set_bind ] [from value_changed to Debug.setFrontDownBSOutput ] -->
               <BooleanSequencer DEF='FrontDownViewBinderkey='0.75 0.85keyValue='true false'/>
 70                 < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='FrontDownViewBinder' toField='set_fraction'/>
 71                 < ROUTE  fromNode='FrontDownViewBinder' fromField='value_changed' toNode='FrontDownViewpoint' toField='set_bind'/>
 72            </Group>
 73            <Group DEF='AnimatedView6'>
 74 
               <!-- ROUTE information for BottomViewpoint node:  [from BottomViewBinder.value_changed to set_bind ] [from isBound to Debug.setBottomViewBind ] -->
               <Viewpoint DEF='BottomViewpointdescription='View 6, Bottomorientation='1 0 0 1.57position='0 -10 0'/>
 75 
               <!-- ROUTE information for BottomViewBinder node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to BottomViewpoint.set_bind ] [from value_changed to Debug.setBottomBSOutput ] -->
               <BooleanSequencer DEF='BottomViewBinderkey='0.875 0.975keyValue='true false'/>
 76                 < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='BottomViewBinder' toField='set_fraction'/>
 77                 < ROUTE  fromNode='BottomViewBinder' fromField='value_changed' toNode='BottomViewpoint' toField='set_bind'/>
 78            </Group>
 79            <Switch DEF='DebugSwitchwhichChoice='0'>
 80                 <Group>
 81 
 82                           <field name='setFractiontype='SFFloataccessType='inputOnly'/>
 83                           <field name='setFrontUpViewBindtype='SFBoolaccessType='inputOnly'/>
 84                           <field name='setLeftViewBindtype='SFBoolaccessType='inputOnly'/>
 85                           <field name='setBackViewBindtype='SFBoolaccessType='inputOnly'/>
 86                           <field name='setRightViewBindtype='SFBoolaccessType='inputOnly'/>
 87                           <field name='setTopViewBindtype='SFBoolaccessType='inputOnly'/>
 88                           <field name='setFrontDownViewBindtype='SFBoolaccessType='inputOnly'/>
 89                           <field name='setBottomViewBindtype='SFBoolaccessType='inputOnly'/>
 90                           <field name='setFrontUpBSOutputtype='SFBoolaccessType='inputOnly'/>
 91                           <field name='setLeftBSOutputtype='SFBoolaccessType='inputOnly'/>
 92                           <field name='setBackBSOutputtype='SFBoolaccessType='inputOnly'/>
 93                           <field name='setRightBSOutputtype='SFBoolaccessType='inputOnly'/>
 94                           <field name='setTopBSOutputtype='SFBoolaccessType='inputOnly'/>
 95                           <field name='setFrontDownBSOutputtype='SFBoolaccessType='inputOnly'/>
 96                           <field name='setBottomBSOutputtype='SFBoolaccessType='inputOnly'/>
  <![CDATA[
          
ecmascript:

function setFraction(value, timeStamp)
{
	Browser.println ('fraction =' + value);
}

function setFrontUpViewBind(value, timeStamp)
{
	Browser.println ('FrontUpView bind:' + value);
}

function setLeftViewBind(value, timeStamp)
{
	Browser.println ('LeftView bind:' + value);
}

function setBackViewBind(value, timeStamp)
{
	Browser.println ('BackView bind:' + value);
}

function setRightViewBind(value, timeStamp)
{
	Browser.println ('RightView bind:' + value);
}

function setTopViewBind(value, timeStamp)
{
	Browser.println ('TopView bind:' + value);
}

function setFrontDownViewBind(value, timeStamp)
{
	Browser.println ('FrontDownView bind:' + value);
}

function setBottomViewBind(value, timeStamp)
{
	Browser.println ('BottomView bind:' + value);
}

function setFrontUpBSOutput(value, timeStamp)
{
	Browser.println ('BooleanSequencer output for FrontUpViewpoint:' + value);
}

function setLeftBSOutput(value, timeStamp)
{
	Browser.println ('BooleanSequencer output for LeftViewpoint:' + value);
}

function setBackBSOutput(value, timeStamp)
{
	Browser.println ('BooleanSequencer output for BackViewpoint:' + value);
}

function setRightBSOutput(value, timeStamp)
{
	Browser.println ('BooleanSequencer output for RightViewpoint:' + value);
}

function setTopBSOutput(value, timeStamp)
{
	Browser.println ('BooleanSequencer output for TopViewpoint:' + value);
}

function setFrontDownBSOutput(value, timeStamp)
{
	Browser.println ('BooleanSequencer output for FrontDownViewpoint:' + value);
}

function setBottomBSOutput(value, timeStamp)
{
	Browser.println ('BooleanSequencer output for BottomViewpoint:' + value);
}

        
]]>
 98                      </Script>
 99                      < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='Debug' toField='setFraction'/>
100                      < ROUTE  fromNode='FrontUpViewpoint' fromField='isBound' toNode='Debug' toField='setFrontUpViewBind'/>
101                      < ROUTE  fromNode='LeftViewpoint' fromField='isBound' toNode='Debug' toField='setLeftViewBind'/>
102                      < ROUTE  fromNode='BackViewpoint' fromField='isBound' toNode='Debug' toField='setBackViewBind'/>
103                      < ROUTE  fromNode='RightViewpoint' fromField='isBound' toNode='Debug' toField='setRightViewBind'/>
104                      < ROUTE  fromNode='TopViewpoint' fromField='isBound' toNode='Debug' toField='setTopViewBind'/>
105                      < ROUTE  fromNode='FrontDownViewpoint' fromField='isBound' toNode='Debug' toField='setFrontDownViewBind'/>
106                      < ROUTE  fromNode='BottomViewpoint' fromField='isBound' toNode='Debug' toField='setBottomViewBind'/>
107                      < ROUTE  fromNode='LeftViewBinder' fromField='value_changed' toNode='Debug' toField='setLeftBSOutput'/>
108                      < ROUTE  fromNode='BackViewBinder' fromField='value_changed' toNode='Debug' toField='setBackBSOutput'/>
109                      < ROUTE  fromNode='RightViewBinder' fromField='value_changed' toNode='Debug' toField='setRightBSOutput'/>
110                      < ROUTE  fromNode='TopViewBinder' fromField='value_changed' toNode='Debug' toField='setTopBSOutput'/>
111                      < ROUTE  fromNode='FrontDownViewBinder' fromField='value_changed' toNode='Debug' toField='setFrontDownBSOutput'/>
112                      < ROUTE  fromNode='BottomViewBinder' fromField='value_changed' toNode='Debug' toField='setBottomBSOutput'/>
113                 </Group>
114            </Switch>
115            <Transform>
116                 <Shape>
117                      <Appearance>
118                           <Material diffuseColor='1 1 0'/>
119                      </Appearance>
120                      <Box size='2 0.1 0.35'/>
121                 </Shape>
122                 <Transform translation='-1 0 0'>
123                      <Shape>
124                           <Appearance>
125                                <Material diffuseColor='1 0 0'/>
126                           </Appearance>
127                           <Sphere radius='0.2'/>
128                      </Shape>
129                 </Transform>
130                 <Transform translation='1 0 0'>
131                      <Shape>
132                           <Appearance>
133                                <Material diffuseColor='0 1 0'/>
134                           </Appearance>
135                           <Sphere radius='0.2'/>
136                      </Shape>
137                 </Transform>
138            </Transform>
139            <Transform>
140                 <Shape>
141                      <Appearance>
142                           <Material diffuseColor='0 0 1'/>
143                      </Appearance>
144                      <Cone/>
145                 </Shape>
146            </Transform>
147       </Scene>
148  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: AnimatedView1, AnimatedView2, AnimatedView3, AnimatedView4, AnimatedView5, AnimatedView6, BackViewBinder, BackViewpoint, BillboardPlaneTransform, BillboardWhereTransform, BottomViewBinder, BottomViewpoint, Clock, Debug, DebugSwitch, FrontDownViewBinder, FrontDownViewpoint, FrontUpViewpoint, HUDGroup, LeftViewBinder, LeftViewpoint, RightViewBinder, RightViewpoint, TopViewBinder, TopViewpoint, Toucher, WhereSensor

Index for Viewpoint nodes: BackViewpoint, BottomViewpoint, FrontDownViewpoint, FrontUpViewpoint, LeftViewpoint, RightViewpoint, TopViewpoint
-->
X3D Tooltips element index: Appearance, Billboard, BooleanSequencer, Box, Cone, field, FontStyle, Group, head, Material, meta, ProximitySensor, ROUTE, Scene, Script, Shape, Sphere, Switch, Text, TimeSensor, TouchSensor, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

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

Toucher
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
Clock
TimeSensor
set_startTime
SFTime
then
 
 
 
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
LeftViewBinder
BooleanSequencer
set_fraction
SFFloat
then
 
 
 
LeftViewBinder
BooleanSequencer
value_changed
SFBool

ROUTE
event to
(3)
LeftViewpoint
Viewpoint
set_bind
SFBool
then
 
 
 
LeftViewpoint
Viewpoint
isBound
SFBool

ROUTE
event to
(4)
Debug
Script
setLeftViewBind
SFBool
  then
 
 
 
LeftViewBinder
BooleanSequencer
value_changed
SFBool

ROUTE
event to
(3)
Debug
Script
setLeftBSOutput
SFBool
  then
 
 
 
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
BackViewBinder
BooleanSequencer
set_fraction
SFFloat
then
 
 
 
BackViewBinder
BooleanSequencer
value_changed
SFBool

ROUTE
event to
(3)
BackViewpoint
Viewpoint
set_bind
SFBool
then
 
 
 
BackViewpoint
Viewpoint
isBound
SFBool

ROUTE
event to
(4)
Debug
Script
setBackViewBind
SFBool
  then
 
 
 
BackViewBinder
BooleanSequencer
value_changed
SFBool

ROUTE
event to
(3)
Debug
Script
setBackBSOutput
SFBool
  then
 
 
 
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
RightViewBinder
BooleanSequencer
set_fraction
SFFloat
then
 
 
 
RightViewBinder
BooleanSequencer
value_changed
SFBool

ROUTE
event to
(3)
RightViewpoint
Viewpoint
set_bind
SFBool
then
 
 
 
RightViewpoint
Viewpoint
isBound
SFBool

ROUTE
event to
(4)
Debug
Script
setRightViewBind
SFBool
  then
 
 
 
RightViewBinder
BooleanSequencer
value_changed
SFBool

ROUTE
event to
(3)
Debug
Script
setRightBSOutput
SFBool
  then
 
 
 
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
TopViewBinder
BooleanSequencer
set_fraction
SFFloat
then
 
 
 
TopViewBinder
BooleanSequencer
value_changed
SFBool

ROUTE
event to
(3)
TopViewpoint
Viewpoint
set_bind
SFBool
then
 
 
 
TopViewpoint
Viewpoint
isBound
SFBool

ROUTE
event to
(4)
Debug
Script
setTopViewBind
SFBool
  then
 
 
 
TopViewBinder
BooleanSequencer
value_changed
SFBool

ROUTE
event to
(3)
Debug
Script
setTopBSOutput
SFBool
  then
 
 
 
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
FrontDownViewBinder
BooleanSequencer
set_fraction
SFFloat
then
 
 
 
FrontDownViewBinder
BooleanSequencer
value_changed
SFBool

ROUTE
event to
(3)
FrontDownViewpoint
Viewpoint
set_bind
SFBool
then
 
 
 
FrontDownViewpoint
Viewpoint
isBound
SFBool

ROUTE
event to
(4)
Debug
Script
setFrontDownViewBind
SFBool
  then
 
 
 
FrontDownViewBinder
BooleanSequencer
value_changed
SFBool

ROUTE
event to
(3)
Debug
Script
setFrontDownBSOutput
SFBool
  then
 
 
 
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
BottomViewBinder
BooleanSequencer
set_fraction
SFFloat
then
 
 
 
BottomViewBinder
BooleanSequencer
value_changed
SFBool

ROUTE
event to
(3)
BottomViewpoint
Viewpoint
set_bind
SFBool
then
 
 
 
BottomViewpoint
Viewpoint
isBound
SFBool

ROUTE
event to
(4)
Debug
Script
setBottomViewBind
SFBool
  then
 
 
 
BottomViewBinder
BooleanSequencer
value_changed
SFBool

ROUTE
event to
(3)
Debug
Script
setBottomBSOutput
SFBool
  then
 
 
 
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
Debug
Script
setFraction
SFFloat

WhereSensor
ProximitySensor
position_changed
SFVec3f

ROUTE
event to
(1)
BillboardWhereTransform
Transform
set_translation
SFVec3f
WhereSensor
ProximitySensor
orientation_changed
SFRotation

ROUTE
event to
(1)
BillboardWhereTransform
Transform
set_rotation
SFRotation
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/Basic/development/BooleanSequencerExampleIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/development/BooleanSequencerExample.x3d -->

<!-- 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)
-->

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