X3D Model Documentation: DoorDesired.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2  <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.2//EN" "https://www.web3d.org/specifications/x3d-3.2.dtd">
  3  <X3D profile='Immersive' version='3.2 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.2.xsd'>
  4       <head>
  5            <meta name='titlecontent='DoorDesired.x3d'/>
  6            <meta name='descriptioncontent='X3D Follower example'/>
  7            <meta name='creatorcontent='Herbert Stocker'/>
  8            <meta name='translatorcontent='Don Brutzman'/>
  9            <meta name='createdcontent='18 April 2006'/>
 10            <meta name='translatedcontent='2 December 2011'/>
 11            <meta name='modifiedcontent='20 October 2019'/>
 12            <meta name='referencecontent='originals/door_desired.wrl'/>
 13            <meta name='referencecontent='Stocker_06_Followers.pdf'/>
 14            <meta name='referencecontent='http://www.hersto.com/Publications/Followers'/>
 15            <meta name='requirescontent='X3D version 3.2 or greater'/>
 16            <meta name='subjectcontent='X3D Follower Chaser Damper'/>
 17            <meta name=' warning content=' under development, instantReality works but BS Contact fails silently '/>
 18            <meta name='referencecontent='https://www.web3d.org/x3d/specifications/ISO-IEC-19775-1.2-X3D-AbstractSpecification/Part01/components/followers.html'/>
 19            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html'/>
 20            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Basic/Followers/originals/DoorDesired.x3d'/>
 21            <meta name='generatorcontent='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/>
 22            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 23            <meta name='licensecontent='../../license.html'/>
 24       </head>
<!--

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

<!-- to top Index for DEF nodes: Bgnd, DmpODoor, ShCyl, ShWall, TchCyls, TchDoor, TransDoor, Worker

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2
-->
 25       <Scene>
 26            <WorldInfo title='DoorDesired.x3d'/>
 27            <Background DEF='BgndskyAngle='1.1 1.4 1.57skyColor='0.176 0.314 0.529 0.176 0.314 0.529 0.314 0.549 0.784 0.706 0.824 0.922'/>
 28            <Viewpoint description='initial ViewfieldOfView='0.844orientation='-0.0040 1.0 0.0030 0.439position='3.163 1.65 5.877'/>
 29            <Viewpoint description='from the topfieldOfView='0.844orientation='-0.979 -0.051 0.198 1.263position='-1.216 9.189 2.77'/>
 30            <Shape>
 31                 <Appearance>
 32                      <Material diffuseColor='0.0 0.0 0.0emissiveColor='0.318 0.663 0.0'/>
 33                 </Appearance>
 34                 <Box size='100.0 0.1 100.0'/>
 35            </Shape>
 36            <Group>
 37 
               <!-- ROUTE information for TchCyls node:  [from touchTime to Worker.touched ] -->
               <TouchSensor DEF='TchCylsdescription='touch to activate'/>
 38                 <Transform translation='-1.25 1.0 0.0'>
 39 
                    <!-- Shape ShCyl is a DEF node that has 1 USE node: USE_1 -->
                    <Shape DEF='ShCyl'>
 40                           <Appearance>
 41                                <Material ambientIntensity='0.00333diffuseColor='0.52 0.26 0.0emissiveColor='0.24 0.0 0.0shininess='0.12specularColor='0.97 0.98 0.12'/>
 42                           </Appearance>
 43                           <Cylinder radius='0.375'/>
 44                      </Shape>
 45                 </Transform>
 46                 <Transform translation='1.25 1.0 0.0'>
 47                      <Shape USE='ShCyl'/>
 48                 </Transform>
 49                 <Transform translation='-4.25 1.0 0.0'>
 50 
                    <!-- Shape ShWall is a DEF node that has 1 USE node: USE_1 -->
                    <Shape DEF='ShWall'>
 51                           <Appearance>
 52                                <Material ambientIntensity='0.00333diffuseColor='0.425 0.182 0.0075emissiveColor='0.425 0.182 0.0075shininess='0.12'/>
 53                           </Appearance>
 54                           <Box size='6.0 1.99 0.1'/>
 55                      </Shape>
 56                 </Transform>
 57            </Group>
 58            <Transform translation='4.25 1.0 0.0'>
 59                 <Shape USE='ShWall'/>
 60            </Transform>
 61            <Transform translation='-1.25 0.0 0.0'>
 62 
               <!-- ROUTE information for TchDoor node:  [from touchTime to Worker.touched ] -->
               <TouchSensor DEF='TchDoordescription='touch to activate'/>
 63 
               <!-- ROUTE information for TransDoor node:  [from DmpODoor.value_changed to rotation ] -->
               <Transform DEF='TransDoor'>
 64                      <Transform translation='1.25 1.0 0.0'>
 65                           <Shape>
 66                                <Appearance>
 67                                     <Material diffuseColor='0.024 0.2 0.334emissiveColor='0.05 0.4 0.666'/>
 68                                </Appearance>
 69                                <Box size='1.75 2.0 0.075'/>
 70                           </Shape>
 71                      </Transform>
 72                 </Transform>
 73            </Transform>
 74 
          <!-- ROUTE information for DmpODoor node:  [from Worker.oriToGoTo to set_destination ] [from value_changed to TransDoor.rotation ] -->
          <OrientationChaser DEF='DmpODoorduration='1.3containerField='children'/>
 75 
          <!-- ROUTE information for Worker node:  [from TchDoor.touchTime to touched ] [from TchCyls.touchTime to touched ] [from oriToGoTo to DmpODoor.set_destination ] -->
          <Script DEF='Worker'>
 76                 <field name='cOriOpentype='SFRotationvalue='0.0 -1.0 0.0 2.5accessType='initializeOnly'/>
 77                 <field name='touchedtype='SFTimeaccessType='inputOnly'/>
 78                 <field name='IsOpentype='SFBoolvalue='falseaccessType='initializeOnly'/>
 79                 <field name='oriToGoTotype='SFRotationaccessType='outputOnly'/>
 80                 <field name='cOriClosedtype='SFRotationvalue='0.0 0.0 1.0 0.0accessType='initializeOnly'/>
  <![CDATA[
      
ecmascript:

function touched(t)
{
    if(IsOpen)
    {
        oriToGoTo= cOriClosed;
        IsOpen= false;
    }else
    {
        oriToGoTo= cOriOpen;
        IsOpen= true;
    }
}

    
]]>
 82            </Script>
 83            < ROUTE  fromNode='TchDoor' fromField='touchTime' toNode='Worker' toField='touched'/>
 84            < ROUTE  fromNode='TchCyls' fromField='touchTime' toNode='Worker' toField='touched'/>
 85            < ROUTE  fromNode='Worker' fromField='oriToGoTo' toNode='DmpODoor' toField='set_destination'/>
 86            < ROUTE  fromNode='DmpODoor' fromField='value_changed' toNode='TransDoor' toField='rotation'/>
 87       </Scene>
 88  </X3D>
<!--

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

<!-- to top Index for DEF nodes: Bgnd, DmpODoor, ShCyl, ShWall, TchCyls, TchDoor, TransDoor, Worker

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2
-->
X3D Tooltips element index: Appearance, Background, Box, Cylinder, field, Group, head, Material, meta, OrientationChaser, ROUTE, Scene, Script, Shape, TouchSensor, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

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

TchCyls
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
Worker
Script
touched
SFTime
then
 
 
 
Worker
Script
oriToGoTo
SFRotation

ROUTE
event to
(2)
DmpODoor
OrientationChaser
set_destination
SFRotation
then
 
 
 
DmpODoor
OrientationChaser
value_changed
SFRotation

ROUTE
event to
(3)
TransDoor
Transform
rotation
SFRotation

TchDoor
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
Worker
Script
touched
SFTime
then
 
 
 
Worker
Script
oriToGoTo
SFRotation

ROUTE
event to
(2)
DmpODoor
OrientationChaser
set_destination
SFRotation
then
 
 
 
DmpODoor
OrientationChaser
value_changed
SFRotation

ROUTE
event to
(3)
TransDoor
Transform
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/Followers/originals/DoorDesiredIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/Followers/originals/DoorDesired.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. -->