X3D Model Documentation: PlaneSensorPumpHouse.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='PlaneSensorPumpHouse.x3d'/>
  6            <meta name='descriptioncontent='PlaneSensor on the red handle controls the overall movement of a positive-displacement cylinder pump.'/>
  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='StringSensorScriptConverter.js'/>
 14            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/PumpHouse.x3d'/>
 15            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/PlaneSensorPumpHouse.x3d'/>
 16            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 17            <meta name='generatorcontent='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/>
 18            <meta name='licensecontent='../license.html'/>
 19       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: AmplitudeMarker, Converter, CylinderRod, PistonClock, PistonLimits, PistonPath, PistonTransform, PumpAmplitude, PumpHouseAppearance, PumpTouchedOption, Rocker1Path, Rocker1Rotation, Rocker2Path, Rocker2Rotation, RockerArm1, RockerArm2

Index for Viewpoint node: Viewpoint_1
-->
 20       <Scene>
 21            <WorldInfo title='PlaneSensorPumpHouse.x3d'/>
 22            <Background skyColor='1 1 1'/>
 23            <Viewpoint description='Book Viewpointorientation='-0.245 0.969 0.023 0.25position='1.92 0.65 4.69'/>
 24            <Group>
 25                 <Transform scale='0.91 0.6 0.3translation='0.8 -0.65 0.5'>
 26                      <Shape>
 27                           <Appearance>
 28                                <Material diffuseColor='0.749 0.694 0.651'/>
 29                           </Appearance>
 30                           <Cylinder bottom='falsetop='false'/>
 31                      </Shape>
 32                 </Transform>
 33                 <Group>
 34                      <!-- modify this TouchSensor to enabled='true' if you want a further on/off control of pump -->
 35 
                    <!-- ROUTE information for PumpTouchedOption node:  [from isActive to PistonClock.enabled ] -->
                    <TouchSensor DEF='PumpTouchedOptiondescription='touch and hold to keep activatedenabled='false'/>
 36                      <Shape>
 37 
                         <!-- 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'>
 38                                <Material diffuseColor='0.82 0.78 0.74'/>
 39                           </Appearance>
 40                           <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'>
 41                                <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'/>
 42                           </IndexedFaceSet>
 43                      </Shape>
 44                 </Group>
 45                 <Transform>
 46 
                    <!-- ROUTE information for PumpAmplitude node:  [from translation_changed to Converter.SFVec3fY_SFFloat ] [from translation_changed to AmplitudeMarker.translation ] -->
                    <PlaneSensor DEF='PumpAmplitudedescription='click and drag to raise/lower maximum piston heightmaxPosition='1.5 1.5minPosition='1.5 0.5offset='1.5 1.5 0'/>
 47 
                    <!-- ROUTE information for AmplitudeMarker node:  [from PumpAmplitude.translation_changed to translation ] -->
                    <Transform DEF='AmplitudeMarkerrotation='0 0 1 1.57translation='1.5 1.5 0'>
 48                           <Shape>
 49                                <Appearance>
 50                                     <Material diffuseColor='1 0 0'/>
 51                                </Appearance>
 52                                <Cylinder height='.5radius='.07'/>
 53                           </Shape>
 54                      </Transform>
 55 
                    <!-- ROUTE information for PistonLimits node:  [from Converter.SFFloat_Yout to set_fraction ] [from value_changed to PistonPath.keyValue ] -->
                    <CoordinateInterpolator DEF='PistonLimitskey='0 1keyValue='-0.4 -2.3 4.0 -0.4 -2.3 4.0 -0.4 -2.3 4.0 -0.4 -2.3 4.0 -0.4 -2.3 4.0 -0.4 -2.3 4.0 -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'/>
 56 
                    <!-- ROUTE information for Converter node:  [from PumpAmplitude.translation_changed to SFVec3fY_SFFloat ] [from SFFloat_Yout to PistonLimits.set_fraction ] -->
                    <Script DEF='Converter'>
 57                           <field name='SFVec3fY_SFFloattype='SFVec3faccessType='inputOnly'/>
 58                           <field name='SFFloat_Youttype='SFFloataccessType='outputOnly'/>
  <![CDATA[
          
ecmascript:

function SFVec3fY_SFFloat (value) {
  SFFloat_Yout = value[1];
}

        
]]>
 60                      </Script>
 61                      < ROUTE  fromNode='PumpAmplitude' fromField='translation_changed' toNode='Converter' toField='SFVec3fY_SFFloat'/>
 62                      < ROUTE  fromNode='PumpAmplitude' fromField='translation_changed' toNode='AmplitudeMarker' toField='translation'/>
 63                      < ROUTE  fromNode='Converter' fromField='SFFloat_Yout' toNode='PistonLimits' toField='set_fraction'/>
 64                 </Transform>
 65            </Group>
 66            <Group>
 67                 <Transform scale='0.5 0.5 0.5translation='1.0 1.1 -1.5'>
 68 
                    <!-- ROUTE information for PistonTransform node:  [from PistonPath.value_changed to set_translation ] -->
                    <Transform DEF='PistonTransform'>
 69                           <Transform scale='1.8 1.2 0.6translation='0.0 -0.2 0.0'>
 70                                <Shape>
 71                                     <Appearance>
 72                                          <Material diffuseColor='0.427 0.427 0.42'/>
 73                                     </Appearance>
 74                                     <Cylinder height='1.0radius='0.98'/>
 75                                </Shape>
 76                           </Transform>
 77 
                         <!-- 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'>
 78                                <Shape>
 79                                     <Appearance USE='PumpHouseAppearance'/>
 80                                     <Cylinder height='1.0radius='0.1'/>
 81                                </Shape>
 82                           </Transform>
 83                           <Transform rotation='0.0 0.0 1.0 1.047198translation='1.0 0.6 0.0'>
 84                                <Transform USE='CylinderRod'/>
 85                           </Transform>
 86                           <Transform translation='0.0 1.2 0.0'>
 87                                <Shape>
 88                                     <Appearance USE='PumpHouseAppearance'/>
 89                                     <Sphere radius='0.15'/>
 90                                </Shape>
 91                           </Transform>
 92 
                         <!-- 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'>
 93                                <Shape>
 94                                     <Appearance USE='PumpHouseAppearance'/>
 95                                     <Cylinder height='1.8radius='0.1'/>
 96                                </Shape>
 97                                <Transform translation='0.0 0.95 0.0'>
 98                                     <Shape>
 99                                          <Appearance USE='PumpHouseAppearance'/>
100                                          <Sphere radius='0.15'/>
101                                     </Shape>
102                                </Transform>
103 
                              <!-- 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'/>
104 
                              <!-- 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'/>
105                           </Transform>
106 
                         <!-- 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'>
107                                <Shape>
108                                     <Appearance USE='PumpHouseAppearance'/>
109                                     <Cylinder height='1.8radius='0.1'/>
110                                </Shape>
111                                <Transform translation='0.0 -0.95 0.0'>
112                                     <Shape>
113                                          <Appearance USE='PumpHouseAppearance'/>
114                                          <Sphere radius='0.15'/>
115                                     </Shape>
116                                </Transform>
117 
                              <!-- 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'/>
118 
                              <!-- 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'/>
119                           </Transform>
120                      </Transform>
121 
122 
                    <!-- ROUTE information for PistonPath node:  [from PistonLimits.value_changed to keyValue ] [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'/>
123                 </Transform>
124            </Group>
125            < ROUTE  fromNode='PumpTouchedOption' fromField='isActive' toNode='PistonClock' toField='enabled'/>
126            < ROUTE  fromNode='PistonLimits' fromField='value_changed' toNode='PistonPath' toField='keyValue'/>
127            < ROUTE  fromNode='PistonClock' fromField='fraction_changed' toNode='PistonPath' toField='set_fraction'/>
128            < ROUTE  fromNode='PistonPath' fromField='value_changed' toNode='PistonTransform' toField='set_translation'/>
129            < ROUTE  fromNode='PistonClock' fromField='fraction_changed' toNode='Rocker1Path' toField='set_fraction'/>
130            < ROUTE  fromNode='Rocker1Path' fromField='value_changed' toNode='RockerArm1' toField='set_translation'/>
131            < ROUTE  fromNode='PistonClock' fromField='fraction_changed' toNode='Rocker1Rotation' toField='set_fraction'/>
132            < ROUTE  fromNode='Rocker1Rotation' fromField='value_changed' toNode='RockerArm1' toField='set_rotation'/>
133            < ROUTE  fromNode='PistonClock' fromField='fraction_changed' toNode='Rocker2Path' toField='set_fraction'/>
134            < ROUTE  fromNode='Rocker2Path' fromField='value_changed' toNode='RockerArm2' toField='set_translation'/>
135            < ROUTE  fromNode='PistonClock' fromField='fraction_changed' toNode='Rocker2Rotation' toField='set_fraction'/>
136            < ROUTE  fromNode='Rocker2Rotation' fromField='value_changed' toNode='RockerArm2' toField='set_rotation'/>
137       </Scene>
138  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: AmplitudeMarker, Converter, CylinderRod, PistonClock, PistonLimits, PistonPath, PistonTransform, PumpAmplitude, PumpHouseAppearance, PumpTouchedOption, Rocker1Path, Rocker1Rotation, Rocker2Path, Rocker2Rotation, RockerArm1, RockerArm2

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

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

PumpTouchedOption
TouchSensor
isActive
SFBool

ROUTE
event to
(1)
PistonClock
TimeSensor
enabled
SFBool
then
 
 
 
PistonClock
TimeSensor
fraction_changed
SFFloat

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

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

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

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

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

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

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

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

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

ROUTE
event to
(3)
RockerArm2
Transform
set_rotation
SFRotation

PumpAmplitude
PlaneSensor
translation_changed
SFVec3f

ROUTE
event to
(1)
Converter
Script
SFVec3fY_SFFloat
SFVec3f
then
 
 
 
Converter
Script
SFFloat_Yout
SFFloat

ROUTE
event to
(2)
PistonLimits
CoordinateInterpolator
set_fraction
SFFloat
then
 
 
 
PistonLimits
CoordinateInterpolator
value_changed
MFVec3f

ROUTE
event to
(3)
PistonPath
PositionInterpolator
keyValue
MFVec3f
then
 
 
 
PistonPath
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(4)
PistonTransform
Transform
set_translation
SFVec3f
PumpAmplitude
PlaneSensor
translation_changed
SFVec3f

ROUTE
event to
(1)
AmplitudeMarker
Transform
translation
SFVec3f

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/Chapter08UserInteractivity/PlaneSensorPumpHouseIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/PlaneSensorPumpHouse.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. -->