X3D Model Documentation: BooleanTogglePumpHouse.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='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'>
  4       <head>
  5            <meta name='titlecontent='BooleanTogglePumpHouse.x3d'/>
  6            <meta name='descriptioncontent='A BooleanToggle node controls pump house animation: select to stop, then select again to restart.'/>
  7            <meta name='creatorcontent='Todd Gagnon and Mark A. Boyd'/>
  8            <meta name='translatorcontent='Xeena VRML importer, X3D-Edit 3.1, https://www.web3d.org/x3d/content/README.X3D-Edit.html'/>
  9            <meta name='createdcontent='8 June 1998'/>
 10            <meta name='translatedcontent='20 December 2002'/>
 11            <meta name='modifiedcontent='20 October 2019'/>
 12            <meta name='referencecontent='KelpTank.x3d'/>
 13            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/PumpHouse.x3d'/>
 14            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/BooleanTogglePumpHouse.x3d'/>
 15            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 16            <meta name='generatorcontent='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/>
 17            <meta name='licensecontent='../license.html'/>
 18       </head>
<!--

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

<!-- to top Index for DEF nodes: CylinderRod, Dump, PauseOff, PauseOn, PistonClock, PistonPath, PistonTransform, PumpHouseAppearance, PumpTouched, Rocker1Path, Rocker1Rotation, Rocker2Path, Rocker2Rotation, RockerArm1, RockerArm2, Tee, Toggler

Index for Viewpoint node: Viewpoint_1
-->
 19       <Scene>
 20            <WorldInfo title='BooleanTogglePumpHouse.x3d'/>
 21            <Background skyColor='1 1 1'/>
 22            <Viewpoint description='Click pump house to toggle operationorientation='-0.969 0.239 0.056 0.13position='1.66 1.34 5.95'/>
 23            <Group>
 24                 <Transform scale='0.91 0.6 0.3translation='0.8 -0.65 0.5'>
 25                      <Shape>
 26                           <Appearance>
 27                                <Material diffuseColor='0.749 0.694 0.651'/>
 28                           </Appearance>
 29                           <Cylinder bottom='falsetop='false'/>
 30                      </Shape>
 31                 </Transform>
 32                 <Group>
 33 
                    <!-- ROUTE information for PumpTouched node:  [from isActive to Toggler.set_boolean ] -->
                    <TouchSensor DEF='PumpToucheddescription='touch to activate'/>
 34                      <Shape>
 35 
                         <!-- Appearance PumpHouseAppearance is a DEF node that has 6 USE nodes: USE_1, USE_2, USE_3, USE_4, USE_5, USE_6 -->
                         <Appearance DEF='PumpHouseAppearance'>
 36                                <Material diffuseColor='0.82 0.78 0.74'/>
 37                           </Appearance>
 38                           <IndexedFaceSet coordIndex='0 1 5 4 -1 5 1 2 6 -1 6 2 3 7 -1 3 0 4 7 -1 1 12 13 2 -1 2 13 14 -1 12 15 16 13 -1 15 0 3 16 -1 16 3 17 -1 9 5 6 10 -1 8 9 10 11 -1 4 8 11 7 -1 4 5 9 8 -1 11 10 6 7 -1 3 2 14 17 -1 13 16 17 14 -1'>
 39                                <Coordinate point='0.0 0.0 0.0 2.0 0.0 0.0 2.0 1.75 0.0 0.0 1.75 0.0 0.625 0.75 0.0 1.0 0.75 0.0 1.0 1.6 0.0 0.625 1.6 0.0 0.625 0.75 -0.65 1.0 0.75 -0.65 1.0 1.6 -0.65 0.625 1.6 -0.65 2.0 0.0 -2.7 2.0 1.75 -2.7 2.0 2.5 -1.0 0.0 0.0 -2.7 0.0 1.75 -2.7 0.0 2.5 -1.0'/>
 40                           </IndexedFaceSet>
 41                      </Shape>
 42                 </Group>
 43            </Group>
 44            <Group>
 45                 <Transform scale='0.5 0.5 0.5translation='1.0 1.1 -1.5'>
 46 
                    <!-- ROUTE information for PistonTransform node:  [from PistonPath.value_changed to set_translation ] -->
                    <Transform DEF='PistonTransform'>
 47                           <Transform scale='1.8 1.2 0.6translation='0.0 -0.2 0.0'>
 48                                <Shape>
 49                                     <Appearance>
 50                                          <Material diffuseColor='0.427 0.427 0.42'/>
 51                                     </Appearance>
 52                                     <Cylinder height='1.0radius='0.98'/>
 53                                </Shape>
 54                           </Transform>
 55 
                         <!-- Transform CylinderRod is a DEF node that has 1 USE node: USE_1 -->
                         <Transform DEF='CylinderRodrotation='0.0 0.0 -1.0 0.523599translation='-0.25 0.75 0.0'>
 56                                <Shape>
 57                                     <Appearance USE='PumpHouseAppearance'/>
 58                                     <Cylinder height='1.0radius='0.1'/>
 59                                </Shape>
 60                           </Transform>
 61                           <Transform rotation='0.0 0.0 1.0 1.047198translation='1.0 0.6 0.0'>
 62                                <Transform USE='CylinderRod'/>
 63                           </Transform>
 64                           <Transform translation='0.0 1.2 0.0'>
 65                                <Shape>
 66                                     <Appearance USE='PumpHouseAppearance'/>
 67                                     <Sphere radius='0.15'/>
 68                                </Shape>
 69                           </Transform>
 70 
                         <!-- ROUTE information for RockerArm1 node:  [from Rocker1Path.value_changed to set_translation ] [from Rocker1Rotation.value_changed to set_rotation ] -->
                         <Transform DEF='RockerArm1center='0.0 -0.4 0.0'>
 71                                <Shape>
 72                                     <Appearance USE='PumpHouseAppearance'/>
 73                                     <Cylinder height='1.8radius='0.1'/>
 74                                </Shape>
 75                                <Transform translation='0.0 0.95 0.0'>
 76                                     <Shape>
 77                                          <Appearance USE='PumpHouseAppearance'/>
 78                                          <Sphere radius='0.15'/>
 79                                     </Shape>
 80                                </Transform>
 81 
                              <!-- ROUTE information for Rocker1Path node:  [from PistonClock.fraction_changed to set_fraction ] [from value_changed to RockerArm1.set_translation ] -->
                              <PositionInterpolator DEF='Rocker1Pathkey='0.0 0.3 0.32 0.5 0.75 1.0keyValue='0.0 2.0 -0.25 0.0 1.8 -0.35 0.0 1.8 -0.35 0.0 2.0 -0.25 0.0 2.0 -0.12 0.0 2.0 -0.25'/>
 82 
                              <!-- ROUTE information for Rocker1Rotation node:  [from PistonClock.fraction_changed to set_fraction ] [from value_changed to RockerArm1.set_rotation ] -->
                              <OrientationInterpolator DEF='Rocker1Rotationkey='0.0 0.3 0.32 0.5 0.75 1.0keyValue='-1.0 0.0 0.0 0.523599 -1.0 0.0 0.0 1.0471976 -1.0 0.0 0.0 1.0471976 -1.0 0.0 0.0 0.523599 -1.0 0.0 0.0 0.2617994 -1.0 0.0 0.0 0.523599'/>
 83                           </Transform>
 84 
                         <!-- ROUTE information for RockerArm2 node:  [from Rocker2Path.value_changed to set_translation ] [from Rocker2Rotation.value_changed to set_rotation ] -->
                         <Transform DEF='RockerArm2center='0.0 0.7 0.0'>
 85                                <Shape>
 86                                     <Appearance USE='PumpHouseAppearance'/>
 87                                     <Cylinder height='1.8radius='0.1'/>
 88                                </Shape>
 89                                <Transform translation='0.0 -0.95 0.0'>
 90                                     <Shape>
 91                                          <Appearance USE='PumpHouseAppearance'/>
 92                                          <Sphere radius='0.15'/>
 93                                     </Shape>
 94                                </Transform>
 95 
                              <!-- ROUTE information for Rocker2Path node:  [from PistonClock.fraction_changed to set_fraction ] [from value_changed to RockerArm2.set_translation ] -->
                              <PositionInterpolator DEF='Rocker2Pathkey='0.0 0.3 0.32 0.5 0.75 1.0keyValue='0.0 1.95 -1.0 0.0 1.2 -1.6 0.0 1.2 -1.6 0.0 1.95 -1.0 0.0 2.2 -0.65 0.0 1.95 -1.0'/>
 96 
                              <!-- ROUTE information for Rocker2Rotation node:  [from PistonClock.fraction_changed to set_fraction ] [from value_changed to RockerArm2.set_rotation ] -->
                              <OrientationInterpolator DEF='Rocker2Rotationkey='0.0 0.3 0.32 0.5 0.75 1.0keyValue='1.0 0.0 0.0 0.523599 1.0 0.0 0.0 0.4 1.0 0.0 0.0 0.4 1.0 0.0 0.0 0.523599 1.0 0.0 0.0 1.570796 1.0 0.0 0.0 0.523599'/>
 97                           </Transform>
 98                      </Transform>
 99 
100 
                    <!-- ROUTE information for PistonPath node:  [from PistonClock.fraction_changed to set_fraction ] [from value_changed to PistonTransform.set_translation ] -->
                    <PositionInterpolator DEF='PistonPathkey='0.0 0.3 0.32 0.5 0.75 1.0keyValue='-0.4 -2.3 4.0 -0.4 -1.5 4.0 -0.4 -1.5 4.0 -0.4 -2.3 4.0 -0.4 -3.3 4.0 -0.4 -2.3 4.0'/>
101 
                    <!-- ROUTE information for Toggler node:  [from PumpTouched.isActive to set_boolean ] [from toggle_changed to Tee.set_boolean ] -->
                    <BooleanToggle DEF='TogglercontainerField='children'/>
102 
                    <!-- ROUTE information for Tee node:  [from Toggler.toggle_changed to set_boolean ] [from inputTrue to Dump.dumpSFBool ] [from inputTrue to PauseOn.set_boolean ] [from inputFalse to PauseOff.set_boolean ] -->
                    <BooleanFilter DEF='Tee'/>
103 
                    <!-- ROUTE information for PauseOn node:  [from Tee.inputTrue to set_boolean ] [from triggerTime to Dump.dumpSFTime ] [from triggerTime to PistonClock.pauseTime ] -->
                    <TimeTrigger DEF='PauseOn'/>
104 
                    <!-- ROUTE information for PauseOff node:  [from Tee.inputFalse to set_boolean ] [from triggerTime to PistonClock.resumeTime ] -->
                    <TimeTrigger DEF='PauseOff'/>
105                 </Transform>
106            </Group>
107 
108                 <field name='dumpSFBooltype='SFBoolaccessType='inputOnly'/>
109                 <field name='dumpSFTimetype='SFTimeaccessType='inputOnly'/>
110            </Script>
111            < ROUTE  fromNode='PumpTouched' fromField='isActive' toNode='Toggler' toField='set_boolean'/>
112            < ROUTE  fromNode='Tee' fromField='inputTrue' toNode='Dump' toField='dumpSFBool'/>
113            < ROUTE  fromNode='PauseOn' fromField='triggerTime' toNode='Dump' toField='dumpSFTime'/>
114            < ROUTE  fromNode='Toggler' fromField='toggle_changed' toNode='Tee' toField='set_boolean'/>
115            < ROUTE  fromNode='Tee' fromField='inputTrue' toNode='PauseOn' toField='set_boolean'/>
116            < ROUTE  fromNode='Tee' fromField='inputFalse' toNode='PauseOff' toField='set_boolean'/>
117            < ROUTE  fromNode='PauseOn' fromField='triggerTime' toNode='PistonClock' toField='pauseTime'/>
118            < ROUTE  fromNode='PauseOff' fromField='triggerTime' toNode='PistonClock' toField='resumeTime'/>
119            < ROUTE  fromNode='PistonClock' fromField='fraction_changed' toNode='PistonPath' toField='set_fraction'/>
120            < ROUTE  fromNode='PistonPath' fromField='value_changed' toNode='PistonTransform' toField='set_translation'/>
121            < ROUTE  fromNode='PistonClock' fromField='fraction_changed' toNode='Rocker1Path' toField='set_fraction'/>
122            < ROUTE  fromNode='Rocker1Path' fromField='value_changed' toNode='RockerArm1' toField='set_translation'/>
123            < ROUTE  fromNode='PistonClock' fromField='fraction_changed' toNode='Rocker1Rotation' toField='set_fraction'/>
124            < ROUTE  fromNode='Rocker1Rotation' fromField='value_changed' toNode='RockerArm1' toField='set_rotation'/>
125            < ROUTE  fromNode='PistonClock' fromField='fraction_changed' toNode='Rocker2Path' toField='set_fraction'/>
126            < ROUTE  fromNode='Rocker2Path' fromField='value_changed' toNode='RockerArm2' toField='set_translation'/>
127            < ROUTE  fromNode='PistonClock' fromField='fraction_changed' toNode='Rocker2Rotation' toField='set_fraction'/>
128            < ROUTE  fromNode='Rocker2Rotation' fromField='value_changed' toNode='RockerArm2' toField='set_rotation'/>
129       </Scene>
130  </X3D>
<!--

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

<!-- to top Index for DEF nodes: CylinderRod, Dump, PauseOff, PauseOn, PistonClock, PistonPath, PistonTransform, PumpHouseAppearance, PumpTouched, Rocker1Path, Rocker1Rotation, Rocker2Path, Rocker2Rotation, RockerArm1, RockerArm2, Tee, Toggler

Index for Viewpoint node: Viewpoint_1
-->
X3D Tooltips element index: Appearance, Background, BooleanFilter, BooleanToggle, Coordinate, Cylinder, field, Group, head, IndexedFaceSet, Material, meta, OrientationInterpolator, PositionInterpolator, ROUTE, Scene, Script, Shape, Sphere, TimeSensor, TimeTrigger, TouchSensor, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

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

PumpTouched
TouchSensor
isActive
SFBool

ROUTE
event to
(1)
Toggler
BooleanToggle
set_boolean
SFBool
then
 
 
 
Toggler
BooleanToggle
toggle_changed
SFBool

ROUTE
event to
(2)
Tee
BooleanFilter
set_boolean
SFBool
then
 
 
 
Tee
BooleanFilter
inputFalse
SFBool

ROUTE
event to
(3)
PauseOff
TimeTrigger
set_boolean
SFBool
then
 
 
 
PauseOff
TimeTrigger
triggerTime
SFTime

ROUTE
event to
(4)
PistonClock
TimeSensor
resumeTime
SFTime
then
 
 
 
PistonClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(5)
PistonPath
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
PistonPath
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(6)
PistonTransform
Transform
set_translation
SFVec3f
  then
 
 
 
PistonClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(5)
Rocker1Path
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
Rocker1Path
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(6)
RockerArm1
Transform
set_translation
SFVec3f
  then
 
 
 
PistonClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(5)
Rocker1Rotation
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
Rocker1Rotation
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(6)
RockerArm1
Transform
set_rotation
SFRotation
  then
 
 
 
PistonClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(5)
Rocker2Path
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
Rocker2Path
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(6)
RockerArm2
Transform
set_translation
SFVec3f
  then
 
 
 
PistonClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(5)
Rocker2Rotation
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
Rocker2Rotation
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(6)
RockerArm2
Transform
set_rotation
SFRotation
  then
 
 
 
Tee
BooleanFilter
inputTrue
SFBool

ROUTE
event to
(3)
Dump
Script
dumpSFBool
SFBool
  then
 
 
 
Tee
BooleanFilter
inputTrue
SFBool

ROUTE
event to
(3)
PauseOn
TimeTrigger
set_boolean
SFBool
then
 
 
 
PauseOn
TimeTrigger
triggerTime
SFTime

ROUTE
event to
(4)
Dump
Script
dumpSFTime
SFTime
  then
 
 
 
PauseOn
TimeTrigger
triggerTime
SFTime

ROUTE
event to
(4)
PistonClock
TimeSensor
pauseTime
SFTime
then
 
 
 
PistonClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(5)
PistonPath
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
PistonPath
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(6)
PistonTransform
Transform
set_translation
SFVec3f
  then
 
 
 
PistonClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(5)
Rocker1Path
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
Rocker1Path
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(6)
RockerArm1
Transform
set_translation
SFVec3f
  then
 
 
 
PistonClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(5)
Rocker1Rotation
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
Rocker1Rotation
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(6)
RockerArm1
Transform
set_rotation
SFRotation
  then
 
 
 
PistonClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(5)
Rocker2Path
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
Rocker2Path
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(6)
RockerArm2
Transform
set_translation
SFVec3f
  then
 
 
 
PistonClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(5)
Rocker2Rotation
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
Rocker2Rotation
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(6)
RockerArm2
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/X3dForWebAuthors/Chapter09EventUtilitiesScripting/BooleanTogglePumpHouseIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/BooleanTogglePumpHouse.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. -->