<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.2//EN" "https://www.web3d.org/specifications/x3d-3.2.dtd">
<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 ' >
<head>
<meta name='titlecontent=' DoorDesired.x3d '/>
<meta name='descriptioncontent='X3D Follower example'/>
<meta name='creatorcontent='Herbert Stocker'/>
<meta name='translatorcontent='Don Brutzman'/>
<meta name='createdcontent='18 April 2006'/>
<meta name='translatedcontent='2 December 2011'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='referencecontent='originals/door_desired.wrl'/>
<meta name='referencecontent=' Stocker_06_Followers.pdf '/>
<meta name='referencecontent=' http://www.hersto.com/Publications/Followers '/>
<meta name='requirescontent='X3D version 3.2 or greater'/>
<meta name='subjectcontent='X3D Follower Chaser Damper'/>
<meta name=' warning content=' under development, instantReality works but BS Contact fails silently '/>
<meta name='referencecontent=' https://www.web3d.org/x3d/specifications/ISO-IEC-19775-1.2-X3D-AbstractSpecification/Part01/components/followers.html '/>
<meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html '/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Basic/Followers/originals/DoorDesired.x3d '/>
<meta name='generatorcontent=' Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: Bgnd, DmpODoor, ShCyl, ShWall, TchCyls, TchDoor, TransDoor, Worker

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2
-->
<Scene>
<WorldInfo title='DoorDesired.x3d'/>
<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'/>
<Viewpoint description='initial ViewfieldOfView='0.844orientation='-0.0040 1.0 0.0030 0.439position='3.163 1.65 5.877'/>
<Viewpoint description='from the topfieldOfView='0.844orientation='-0.979 -0.051 0.198 1.263position='-1.216 9.189 2.77'/>
<Shape>
<Appearance>
<Material diffuseColor='0.0 0.0 0.0emissiveColor='0.318 0.663 0.0'/>
</Appearance>
<Box size='100.0 0.1 100.0'/>
</Shape>
<Group>
<!-- ROUTE information for TchCyls node:  [from touchTime to Worker.touched ] -->
<TouchSensor DEF='TchCylsdescription='touch to activate'/>

<Transform translation='-1.25 1.0 0.0'>
<Shape DEF='ShCyl'>
<Appearance>
<Material ambientIntensity='0.00333diffuseColor='0.52 0.26 0.0emissiveColor='0.24 0.0 0.0shininess='0.12specularColor='0.97 0.98 0.12'/>
</Appearance>
<Cylinder radius='0.375'/>
</Shape>
</Transform>
<Transform translation='1.25 1.0 0.0'>
<Shape USE=' ShCyl'/>
</Transform>
<Transform translation='-4.25 1.0 0.0'>
<Shape DEF='ShWall'>
<Appearance>
<Material ambientIntensity='0.00333diffuseColor='0.425 0.182 0.0075emissiveColor='0.425 0.182 0.0075shininess='0.12'/>
</Appearance>
<Box size='6.0 1.99 0.1'/>
</Shape>
</Transform>
</Group>
<Transform translation='4.25 1.0 0.0'>
<Shape USE=' ShWall'/>
</Transform>
<Transform translation='-1.25 0.0 0.0'>
<!-- ROUTE information for TchDoor node:  [from touchTime to Worker.touched ] -->
<TouchSensor DEF='TchDoordescription='touch to activate'/>

<!-- ROUTE information for TransDoor node:  [from DmpODoor.value_changed to rotation ] -->
<Transform DEF='TransDoor'>
<Transform translation='1.25 1.0 0.0'>
<Shape>
<Appearance>
<Material diffuseColor='0.024 0.2 0.334emissiveColor='0.05 0.4 0.666'/>
</Appearance>
<Box size='1.75 2.0 0.075'/>
</Shape>
</Transform>
</Transform>
</Transform>
<!-- ROUTE information for DmpODoor node:  [from Worker.oriToGoTo to set_destination ] [from value_changed to TransDoor.rotation ] -->
<OrientationChaser DEF='DmpODoorduration='1.3containerField='children'/>

<field name='cOriOpentype='SFRotationvalue='0.0 -1.0 0.0 2.5accessType='initializeOnly'/>
<field name='touchedtype='SFTimeaccessType='inputOnly'/>
<field name='IsOpentype='SFBoolvalue='falseaccessType='initializeOnly'/>
<field name='oriToGoTotype='SFRotationaccessType='outputOnly'/>
<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;
    }
}

    
]]>
</Script>
< ROUTE  fromNode=' TchDoor' fromField='touchTime' toNode=' Worker' toField='touched'/>
< ROUTE  fromNode=' TchCyls' fromField='touchTime' toNode=' Worker' toField='touched'/>
< ROUTE  fromNode=' Worker' fromField='oriToGoTo' toNode=' DmpODoor' toField='set_destination'/>
< ROUTE  fromNode=' DmpODoor' fromField='value_changed' toNode=' TransDoor' toField='rotation'/>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: Bgnd, DmpODoor, ShCyl, ShWall, TchCyls, TchDoor, TransDoor, Worker

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2
-->

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



-->

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