X3D Model Documentation: Proximity2.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='Proximity2.x3d'/>
  6            <meta name='descriptioncontent='Proximity pillars example illustrates the use of proximity sensors to sense when the user gets close, and trigger animations or sounds.'/>
  7            <meta name='creatorcontent='David R. Nadeau'/>
  8            <meta name='translatorcontent='Don Brutzman'/>
  9            <meta name='createdcontent='1 July 1998'/>
 10            <meta name='translatedcontent='2 February 2014'/>
 11            <meta name='modifiedcontent='20 October 2019'/>
 12            <meta name='referencecontent='originals/prox2.wrl'/>
 13            <meta name='referencecontent='http://www.siggraph.org/s98'/>
 14            <meta name='referencecontent='http://www.siggraph.org/s98/conference/courses/18.html'/>
 15            <meta name='referencecontent='http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/slides/mt0376.htm'/>
 16            <meta name='referencecontent='http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/vrml97.htm'/>
 17            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/X3dResources.html'/>
 18            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Proximity2.x3d'/>
 19            <meta name='generatorcontent='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/>
 20            <meta name='generatorcontent='X3D-Edit, https://savage.nps.edu/X3D-Edit'/>
 21            <meta name='licensecontent='../license.html'/>
 22       </head>
<!--

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

<!-- to top Index for DEF nodes: Bonk, ClockOffBar1, ClockOffBar2, ClockOffBar3, ClockOffBar4, ClockOnBar1, ClockOnBar2, ClockOnBar3, ClockOnBar4, HitBar1, HitBar2, HitBar3, HitBar4, MaterialBar1, MaterialBar2, MaterialBar3, MaterialBar4, NearBar1, NearBar2, NearBar3, NearBar4, OffBar1, OffBar2, OffBar3, OffBar4, OnBar1, OnBar2, OnBar3, OnBar4

Index for Viewpoint node: Viewpoint_1
-->
 23       <Scene>
 24            <WorldInfo info='"Copyright (c) 1997, David R. Nadeau"title='Proximity pillars'/>
 25            <Viewpoint description='Entry vieworientation='0.0 1.0 0.0 0.785position='7.5 1.7 7.5'/>
 26            <NavigationInfo headlight='falsespeed='3.0'/>
 27            <Background skyAngle='1.57 1.87skyColor='0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0'/>
 28            <Fog color='0.1 0.1 0.1visibilityRange='18.0'/>
 29            <DirectionalLight direction='-1.0 -0.5 -0.5'/>
 30            <Shape>
 31                 <Appearance>
 32                      <TextureTransform scale='16.0 16.0'/>
 33                      <ImageTexture   url=' "grill.png " "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/grill.png " '/>
 34                 </Appearance>
 35                 <IndexedFaceSet coordIndex='0 1 2 3texCoordIndex='0 1 2 3'>
 36                      <TextureCoordinate point='0.0 0.0 1.0 0.0 1.0 1.0 0.0 1.0'/>
 37                      <Coordinate point='-16.0 0.0 16.0 16.0 0.0 16.0 16.0 0.0 -16.0 -16.0 0.0 -16.0'/>
 38                 </IndexedFaceSet>
 39            </Shape>
 40            <Sound maxBack='100.0maxFront='100.0minBack='100.0minFront='100.0'>
 41 
 42            </Sound>
 43 
          <!-- ROUTE information for HitBar1 node:  [from collideTime to Bonk.set_startTime ] -->
          <Collision DEF='HitBar1'>
 44                 <Transform translation='-2.0 0.0 2.0'>
 45 
                    <!-- ROUTE information for NearBar1 node:  [from enterTime to ClockOnBar1.set_startTime ] [from exitTime to ClockOffBar1.set_startTime ] -->
                    <ProximitySensor DEF='NearBar1size='14.0 14.0 14.0'/>
 46                      <Shape>
 47                           <Appearance>
 48 
                              <!-- ROUTE information for MaterialBar1 node:  [from OnBar1.value_changed to set_transparency ] [from OffBar1.value_changed to set_transparency ] -->
                              <Material DEF='MaterialBar1diffuseColor='0.0 0.3 1.0transparency='1.0'/>
 49                           </Appearance>
 50                           <IndexedFaceSet coordIndex='0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1 3 0 4 7 -1 4 5 6 7 -1'>
 51                                <Coordinate point='-0.5 0.0 0.5 0.5 0.0 0.5 0.5 0.0 -0.5 -0.5 0.0 -0.5 -0.5 4.0 0.5 0.5 4.0 0.5 0.5 4.0 -0.5 -0.5 4.0 -0.5'/>
 52                           </IndexedFaceSet>
 53                      </Shape>
 54                 </Transform>
 55            </Collision>
 56 
          <!-- ROUTE information for ClockOnBar1 node:  [from NearBar1.enterTime to set_startTime ] [from fraction_changed to OnBar1.set_fraction ] -->
          <TimeSensor DEF='ClockOnBar1stopTime='1.0'/>
 57 
          <!-- ROUTE information for ClockOffBar1 node:  [from NearBar1.exitTime to set_startTime ] [from fraction_changed to OffBar1.set_fraction ] -->
          <TimeSensor DEF='ClockOffBar1stopTime='1.0'/>
 58 
          <!-- ROUTE information for OnBar1 node:  [from ClockOnBar1.fraction_changed to set_fraction ] [from value_changed to MaterialBar1.set_transparency ] -->
          <ScalarInterpolator DEF='OnBar1key='0.0 1.0keyValue='1.0 0.0'/>
 59 
          <!-- ROUTE information for OffBar1 node:  [from ClockOffBar1.fraction_changed to set_fraction ] [from value_changed to MaterialBar1.set_transparency ] -->
          <ScalarInterpolator DEF='OffBar1key='0.0 1.0keyValue='0.0 1.0'/>
 60            < ROUTE  fromNode='NearBar1' fromField='enterTime' toNode='ClockOnBar1' toField='set_startTime'/>
 61            < ROUTE  fromNode='NearBar1' fromField='exitTime' toNode='ClockOffBar1' toField='set_startTime'/>
 62            < ROUTE  fromNode='ClockOnBar1' fromField='fraction_changed' toNode='OnBar1' toField='set_fraction'/>
 63            < ROUTE  fromNode='ClockOffBar1' fromField='fraction_changed' toNode='OffBar1' toField='set_fraction'/>
 64            < ROUTE  fromNode='OnBar1' fromField='value_changed' toNode='MaterialBar1' toField='set_transparency'/>
 65            < ROUTE  fromNode='OffBar1' fromField='value_changed' toNode='MaterialBar1' toField='set_transparency'/>
 66            < ROUTE  fromNode='HitBar1' fromField='collideTime' toNode='Bonk' toField='set_startTime'/>
 67 
          <!-- ROUTE information for HitBar2 node:  [from collideTime to Bonk.set_startTime ] -->
          <Collision DEF='HitBar2'>
 68                 <Transform translation='4.0 0.0 0.0'>
 69 
                    <!-- ROUTE information for NearBar2 node:  [from enterTime to ClockOnBar2.set_startTime ] [from exitTime to ClockOffBar2.set_startTime ] -->
                    <ProximitySensor DEF='NearBar2size='14.0 14.0 14.0'/>
 70                      <Shape>
 71                           <Appearance>
 72 
                              <!-- ROUTE information for MaterialBar2 node:  [from OnBar2.value_changed to set_transparency ] [from OffBar2.value_changed to set_transparency ] -->
                              <Material DEF='MaterialBar2diffuseColor='0.0 1.0 0.0transparency='1.0'/>
 73                           </Appearance>
 74                           <IndexedFaceSet coordIndex='0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1 3 0 4 7 -1 4 5 6 7 -1'>
 75                                <Coordinate point='-0.5 0.0 0.5 0.5 0.0 0.5 0.5 0.0 -0.5 -0.5 0.0 -0.5 -0.5 2.0 0.5 0.5 2.0 0.5 0.5 2.0 -0.5 -0.5 2.0 -0.5'/>
 76                           </IndexedFaceSet>
 77                      </Shape>
 78                 </Transform>
 79            </Collision>
 80 
          <!-- ROUTE information for ClockOnBar2 node:  [from NearBar2.enterTime to set_startTime ] [from fraction_changed to OnBar2.set_fraction ] -->
          <TimeSensor DEF='ClockOnBar2stopTime='1.0'/>
 81 
          <!-- ROUTE information for ClockOffBar2 node:  [from NearBar2.exitTime to set_startTime ] [from fraction_changed to OffBar2.set_fraction ] -->
          <TimeSensor DEF='ClockOffBar2stopTime='1.0'/>
 82 
          <!-- ROUTE information for OnBar2 node:  [from ClockOnBar2.fraction_changed to set_fraction ] [from value_changed to MaterialBar2.set_transparency ] -->
          <ScalarInterpolator DEF='OnBar2key='0.0 1.0keyValue='1.0 0.0'/>
 83 
          <!-- ROUTE information for OffBar2 node:  [from ClockOffBar2.fraction_changed to set_fraction ] [from value_changed to MaterialBar2.set_transparency ] -->
          <ScalarInterpolator DEF='OffBar2key='0.0 1.0keyValue='0.0 1.0'/>
 84            < ROUTE  fromNode='NearBar2' fromField='enterTime' toNode='ClockOnBar2' toField='set_startTime'/>
 85            < ROUTE  fromNode='NearBar2' fromField='exitTime' toNode='ClockOffBar2' toField='set_startTime'/>
 86            < ROUTE  fromNode='ClockOnBar2' fromField='fraction_changed' toNode='OnBar2' toField='set_fraction'/>
 87            < ROUTE  fromNode='ClockOffBar2' fromField='fraction_changed' toNode='OffBar2' toField='set_fraction'/>
 88            < ROUTE  fromNode='OnBar2' fromField='value_changed' toNode='MaterialBar2' toField='set_transparency'/>
 89            < ROUTE  fromNode='OffBar2' fromField='value_changed' toNode='MaterialBar2' toField='set_transparency'/>
 90            < ROUTE  fromNode='HitBar2' fromField='collideTime' toNode='Bonk' toField='set_startTime'/>
 91 
          <!-- ROUTE information for HitBar3 node:  [from collideTime to Bonk.set_startTime ] -->
          <Collision DEF='HitBar3'>
 92                 <Transform translation='-4.0 0.0 -4.0'>
 93 
                    <!-- ROUTE information for NearBar3 node:  [from enterTime to ClockOnBar3.set_startTime ] [from exitTime to ClockOffBar3.set_startTime ] -->
                    <ProximitySensor DEF='NearBar3size='14.0 14.0 14.0'/>
 94                      <Shape>
 95                           <Appearance>
 96 
                              <!-- ROUTE information for MaterialBar3 node:  [from OnBar3.value_changed to set_transparency ] [from OffBar3.value_changed to set_transparency ] -->
                              <Material DEF='MaterialBar3diffuseColor='1.0 1.0 0.0transparency='1.0'/>
 97                           </Appearance>
 98                           <IndexedFaceSet coordIndex='0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1 3 0 4 7 -1 4 5 6 7 -1'>
 99                                <Coordinate point='-0.5 0.0 0.5 0.5 0.0 0.5 0.5 0.0 -0.5 -0.5 0.0 -0.5 -0.5 4.0 0.5 0.5 4.0 0.5 0.5 4.0 -0.5 -0.5 4.0 -0.5'/>
100                           </IndexedFaceSet>
101                      </Shape>
102                 </Transform>
103            </Collision>
104 
          <!-- ROUTE information for ClockOnBar3 node:  [from NearBar3.enterTime to set_startTime ] [from fraction_changed to OnBar3.set_fraction ] -->
          <TimeSensor DEF='ClockOnBar3stopTime='1.0'/>
105 
          <!-- ROUTE information for ClockOffBar3 node:  [from NearBar3.exitTime to set_startTime ] [from fraction_changed to OffBar3.set_fraction ] -->
          <TimeSensor DEF='ClockOffBar3stopTime='1.0'/>
106 
          <!-- ROUTE information for OnBar3 node:  [from ClockOnBar3.fraction_changed to set_fraction ] [from value_changed to MaterialBar3.set_transparency ] -->
          <ScalarInterpolator DEF='OnBar3key='0.0 1.0keyValue='1.0 0.0'/>
107 
          <!-- ROUTE information for OffBar3 node:  [from ClockOffBar3.fraction_changed to set_fraction ] [from value_changed to MaterialBar3.set_transparency ] -->
          <ScalarInterpolator DEF='OffBar3key='0.0 1.0keyValue='0.0 1.0'/>
108            < ROUTE  fromNode='NearBar3' fromField='enterTime' toNode='ClockOnBar3' toField='set_startTime'/>
109            < ROUTE  fromNode='NearBar3' fromField='exitTime' toNode='ClockOffBar3' toField='set_startTime'/>
110            < ROUTE  fromNode='ClockOnBar3' fromField='fraction_changed' toNode='OnBar3' toField='set_fraction'/>
111            < ROUTE  fromNode='ClockOffBar3' fromField='fraction_changed' toNode='OffBar3' toField='set_fraction'/>
112            < ROUTE  fromNode='OnBar3' fromField='value_changed' toNode='MaterialBar3' toField='set_transparency'/>
113            < ROUTE  fromNode='OffBar3' fromField='value_changed' toNode='MaterialBar3' toField='set_transparency'/>
114            < ROUTE  fromNode='HitBar3' fromField='collideTime' toNode='Bonk' toField='set_startTime'/>
115 
          <!-- ROUTE information for HitBar4 node:  [from collideTime to Bonk.set_startTime ] -->
          <Collision DEF='HitBar4'>
116                 <Transform translation='2.0 0.0 -2.0'>
117 
                    <!-- ROUTE information for NearBar4 node:  [from enterTime to ClockOnBar4.set_startTime ] [from exitTime to ClockOffBar4.set_startTime ] -->
                    <ProximitySensor DEF='NearBar4size='14.0 14.0 14.0'/>
118                      <Shape>
119                           <Appearance>
120 
                              <!-- ROUTE information for MaterialBar4 node:  [from OnBar4.value_changed to set_transparency ] [from OffBar4.value_changed to set_transparency ] -->
                              <Material DEF='MaterialBar4diffuseColor='1.0 0.0 0.0transparency='1.0'/>
121                           </Appearance>
122                           <IndexedFaceSet coordIndex='0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1 3 0 4 7 -1 4 5 6 7 -1'>
123                                <Coordinate point='-0.5 0.0 0.5 0.5 0.0 0.5 0.5 0.0 -0.5 -0.5 0.0 -0.5 -0.5 3.0 0.5 0.5 3.0 0.5 0.5 3.0 -0.5 -0.5 3.0 -0.5'/>
124                           </IndexedFaceSet>
125                      </Shape>
126                 </Transform>
127            </Collision>
128 
          <!-- ROUTE information for ClockOnBar4 node:  [from NearBar4.enterTime to set_startTime ] [from fraction_changed to OnBar4.set_fraction ] -->
          <TimeSensor DEF='ClockOnBar4stopTime='1.0'/>
129 
          <!-- ROUTE information for ClockOffBar4 node:  [from NearBar4.exitTime to set_startTime ] [from fraction_changed to OffBar4.set_fraction ] -->
          <TimeSensor DEF='ClockOffBar4stopTime='1.0'/>
130 
          <!-- ROUTE information for OnBar4 node:  [from ClockOnBar4.fraction_changed to set_fraction ] [from value_changed to MaterialBar4.set_transparency ] -->
          <ScalarInterpolator DEF='OnBar4key='0.0 1.0keyValue='1.0 0.0'/>
131 
          <!-- ROUTE information for OffBar4 node:  [from ClockOffBar4.fraction_changed to set_fraction ] [from value_changed to MaterialBar4.set_transparency ] -->
          <ScalarInterpolator DEF='OffBar4key='0.0 1.0keyValue='0.0 1.0'/>
132            < ROUTE  fromNode='NearBar4' fromField='enterTime' toNode='ClockOnBar4' toField='set_startTime'/>
133            < ROUTE  fromNode='NearBar4' fromField='exitTime' toNode='ClockOffBar4' toField='set_startTime'/>
134            < ROUTE  fromNode='ClockOnBar4' fromField='fraction_changed' toNode='OnBar4' toField='set_fraction'/>
135            < ROUTE  fromNode='ClockOffBar4' fromField='fraction_changed' toNode='OffBar4' toField='set_fraction'/>
136            < ROUTE  fromNode='OnBar4' fromField='value_changed' toNode='MaterialBar4' toField='set_transparency'/>
137            < ROUTE  fromNode='OffBar4' fromField='value_changed' toNode='MaterialBar4' toField='set_transparency'/>
138            < ROUTE  fromNode='HitBar4' fromField='collideTime' toNode='Bonk' toField='set_startTime'/>
139       </Scene>
140  </X3D>
<!--

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

<!-- to top Index for DEF nodes: Bonk, ClockOffBar1, ClockOffBar2, ClockOffBar3, ClockOffBar4, ClockOnBar1, ClockOnBar2, ClockOnBar3, ClockOnBar4, HitBar1, HitBar2, HitBar3, HitBar4, MaterialBar1, MaterialBar2, MaterialBar3, MaterialBar4, NearBar1, NearBar2, NearBar3, NearBar4, OffBar1, OffBar2, OffBar3, OffBar4, OnBar1, OnBar2, OnBar3, OnBar4

Index for Viewpoint node: Viewpoint_1
-->
X3D Tooltips element index: Appearance, AudioClip, Background, Collision, Coordinate, DirectionalLight, Fog, head, ImageTexture, IndexedFaceSet, Material, meta, NavigationInfo, ProximitySensor, ROUTE, ScalarInterpolator, Scene, Shape, Sound, TextureCoordinate, TextureTransform, TimeSensor, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

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

NearBar1
ProximitySensor
enterTime
SFTime

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

ROUTE
event to
(2)
OnBar1
ScalarInterpolator
set_fraction
SFFloat
then
 
 
 
OnBar1
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(3)
MaterialBar1
Material
set_transparency
SFFloat
NearBar1
ProximitySensor
exitTime
SFTime

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

ROUTE
event to
(2)
OffBar1
ScalarInterpolator
set_fraction
SFFloat
then
 
 
 
OffBar1
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(3)
MaterialBar1
Material
set_transparency
SFFloat

NearBar2
ProximitySensor
enterTime
SFTime

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

ROUTE
event to
(2)
OnBar2
ScalarInterpolator
set_fraction
SFFloat
then
 
 
 
OnBar2
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(3)
MaterialBar2
Material
set_transparency
SFFloat
NearBar2
ProximitySensor
exitTime
SFTime

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

ROUTE
event to
(2)
OffBar2
ScalarInterpolator
set_fraction
SFFloat
then
 
 
 
OffBar2
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(3)
MaterialBar2
Material
set_transparency
SFFloat

NearBar3
ProximitySensor
enterTime
SFTime

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

ROUTE
event to
(2)
OnBar3
ScalarInterpolator
set_fraction
SFFloat
then
 
 
 
OnBar3
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(3)
MaterialBar3
Material
set_transparency
SFFloat
NearBar3
ProximitySensor
exitTime
SFTime

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

ROUTE
event to
(2)
OffBar3
ScalarInterpolator
set_fraction
SFFloat
then
 
 
 
OffBar3
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(3)
MaterialBar3
Material
set_transparency
SFFloat

NearBar4
ProximitySensor
enterTime
SFTime

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

ROUTE
event to
(2)
OnBar4
ScalarInterpolator
set_fraction
SFFloat
then
 
 
 
OnBar4
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(3)
MaterialBar4
Material
set_transparency
SFFloat
NearBar4
ProximitySensor
exitTime
SFTime

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

ROUTE
event to
(2)
OffBar4
ScalarInterpolator
set_fraction
SFFloat
then
 
 
 
OffBar4
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(3)
MaterialBar4
Material
set_transparency
SFFloat

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/Vrml2Sourcebook/Siggraph98Course/Proximity2Index.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Proximity2.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. -->