<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<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 ' >
<head>
<meta name='titlecontent=' BooleanSequencerExample.x3d '/>
<meta name='descriptioncontent='This example shows how to use the BooleanSequencer prototype in an animated scenario.'/>
<meta name='creatorcontent='Don Brutzman, Estuko Lippi, Jeff Weekley, Jane Wu'/>
<meta name='createdcontent='10 August 2001'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='referencecontent=' https://www.web3d.org/technicalinfo/specifications/vrml97/part1/nodesRef.html#ScalarInterpolator '/>
<meta name='subjectcontent='boolean sequencer'/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Basic/development/BooleanSequencerExample.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!-- -->
<Scene>
<WorldInfo title='BooleanSequencerExample.x3d'/>
<Group DEF='HUDGroup'>
<!-- 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'/>

<!-- ROUTE information for BillboardWhereTransform node:  [from WhereSensor.position_changed to set_translation ] [from WhereSensor.orientation_changed to set_rotation ] -->
<Transform DEF='BillboardWhereTransform'>
<Transform rotation='1 0 0 -0.03translation='0 0 -12'>
<Billboard>
<Transform DEF='BillboardPlaneTransform'>
<!-- ROUTE information for Toucher node:  [from touchTime to Clock.set_startTime ] -->
<TouchSensor DEF='Toucherdescription='Click text to start clock and run multiple BooleanSequencers'/>

<Shape>
<Appearance>
<Material diffuseColor='0 1 1'/>
</Appearance>
<Text string='"Click text to start clock, run" "multiple BooleanSequencers" "" "" "" "See Viewpoint description" "for bound Viewpoint number"'>
<FontStyle justify='"MIDDLE" "MIDDLE"'/>
</Text>
</Shape>
</Transform>
</Billboard>
</Transform>
</Transform>
< ROUTE  fromNode=' WhereSensor' fromField='position_changed' toNode=' BillboardWhereTransform' toField='set_translation'/>
< ROUTE  fromNode=' WhereSensor' fromField='orientation_changed' toNode=' BillboardWhereTransform' toField='set_rotation'/>
</Group>

< ROUTE  fromNode=' Toucher' fromField='touchTime' toNode=' Clock' toField='set_startTime'/>
<!-- ROUTE information for FrontUpViewpoint node:  [from isBound to Debug.setFrontUpViewBind ] -->
<Viewpoint DEF='FrontUpViewpointdescription='View 0, Front Up'/>

<Group DEF='AnimatedView1'>
<!-- 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'/>

<!-- 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'/>

< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' LeftViewBinder' toField='set_fraction'/>
< ROUTE  fromNode=' LeftViewBinder' fromField='value_changed' toNode=' LeftViewpoint' toField='set_bind'/>
</Group>
<Group DEF='AnimatedView2'>
<!-- 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'/>

<!-- 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'/>

< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' BackViewBinder' toField='set_fraction'/>
< ROUTE  fromNode=' BackViewBinder' fromField='value_changed' toNode=' BackViewpoint' toField='set_bind'/>
</Group>
<Group DEF='AnimatedView3'>
<!-- 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'/>

<!-- 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'/>

< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' RightViewBinder' toField='set_fraction'/>
< ROUTE  fromNode=' RightViewBinder' fromField='value_changed' toNode=' RightViewpoint' toField='set_bind'/>
</Group>
<Group DEF='AnimatedView4'>
<!-- 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'/>

<!-- 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'/>

< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' TopViewBinder' toField='set_fraction'/>
< ROUTE  fromNode=' TopViewBinder' fromField='value_changed' toNode=' TopViewpoint' toField='set_bind'/>
</Group>
<Group DEF='AnimatedView5'>
<!-- 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'/>

<!-- 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'/>

< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' FrontDownViewBinder' toField='set_fraction'/>
< ROUTE  fromNode=' FrontDownViewBinder' fromField='value_changed' toNode=' FrontDownViewpoint' toField='set_bind'/>
</Group>
<Group DEF='AnimatedView6'>
<!-- 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'/>

<!-- 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'/>

< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' BottomViewBinder' toField='set_fraction'/>
< ROUTE  fromNode=' BottomViewBinder' fromField='value_changed' toNode=' BottomViewpoint' toField='set_bind'/>
</Group>
<Switch DEF='DebugSwitchwhichChoice='0'>
<Group>
<field name='setFractiontype='SFFloataccessType='inputOnly'/>
<field name='setFrontUpViewBindtype='SFBoolaccessType='inputOnly'/>
<field name='setLeftViewBindtype='SFBoolaccessType='inputOnly'/>
<field name='setBackViewBindtype='SFBoolaccessType='inputOnly'/>
<field name='setRightViewBindtype='SFBoolaccessType='inputOnly'/>
<field name='setTopViewBindtype='SFBoolaccessType='inputOnly'/>
<field name='setFrontDownViewBindtype='SFBoolaccessType='inputOnly'/>
<field name='setBottomViewBindtype='SFBoolaccessType='inputOnly'/>
<field name='setFrontUpBSOutputtype='SFBoolaccessType='inputOnly'/>
<field name='setLeftBSOutputtype='SFBoolaccessType='inputOnly'/>
<field name='setBackBSOutputtype='SFBoolaccessType='inputOnly'/>
<field name='setRightBSOutputtype='SFBoolaccessType='inputOnly'/>
<field name='setTopBSOutputtype='SFBoolaccessType='inputOnly'/>
<field name='setFrontDownBSOutputtype='SFBoolaccessType='inputOnly'/>
<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);
}

        
]]>
</Script>
< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' Debug' toField='setFraction'/>
< ROUTE  fromNode=' FrontUpViewpoint' fromField='isBound' toNode=' Debug' toField='setFrontUpViewBind'/>
< ROUTE  fromNode=' LeftViewpoint' fromField='isBound' toNode=' Debug' toField='setLeftViewBind'/>
< ROUTE  fromNode=' BackViewpoint' fromField='isBound' toNode=' Debug' toField='setBackViewBind'/>
< ROUTE  fromNode=' RightViewpoint' fromField='isBound' toNode=' Debug' toField='setRightViewBind'/>
< ROUTE  fromNode=' TopViewpoint' fromField='isBound' toNode=' Debug' toField='setTopViewBind'/>
< ROUTE  fromNode=' FrontDownViewpoint' fromField='isBound' toNode=' Debug' toField='setFrontDownViewBind'/>
< ROUTE  fromNode=' BottomViewpoint' fromField='isBound' toNode=' Debug' toField='setBottomViewBind'/>
< ROUTE  fromNode=' LeftViewBinder' fromField='value_changed' toNode=' Debug' toField='setLeftBSOutput'/>
< ROUTE  fromNode=' BackViewBinder' fromField='value_changed' toNode=' Debug' toField='setBackBSOutput'/>
< ROUTE  fromNode=' RightViewBinder' fromField='value_changed' toNode=' Debug' toField='setRightBSOutput'/>
< ROUTE  fromNode=' TopViewBinder' fromField='value_changed' toNode=' Debug' toField='setTopBSOutput'/>
< ROUTE  fromNode=' FrontDownViewBinder' fromField='value_changed' toNode=' Debug' toField='setFrontDownBSOutput'/>
< ROUTE  fromNode=' BottomViewBinder' fromField='value_changed' toNode=' Debug' toField='setBottomBSOutput'/>
</Group>
</Switch>
<Transform>
<Shape>
<Appearance>
<Material diffuseColor='1 1 0'/>
</Appearance>
<Box size='2 0.1 0.35'/>
</Shape>
<Transform translation='-1 0 0'>
<Shape>
<Appearance>
<Material diffuseColor='1 0 0'/>
</Appearance>
<Sphere radius='0.2'/>
</Shape>
</Transform>
<Transform translation='1 0 0'>
<Shape>
<Appearance>
<Material diffuseColor='0 1 0'/>
</Appearance>
<Sphere radius='0.2'/>
</Shape>
</Transform>
</Transform>
<Transform>
<Shape>
<Appearance>
<Material diffuseColor='0 0 1'/>
</Appearance>
<Cone/>
</Shape>
</Transform>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- 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
-->

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


-->

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