| 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='title' content=' DoorDesired.x3d '/> |
| 6 | <meta name='description' content='X3D Follower example'/> |
| 7 | <meta name='creator' content='Herbert Stocker'/> |
| 8 | <meta name='translator' content='Don Brutzman'/> |
| 9 | <meta name='created' content='18 April 2006'/> |
| 10 | <meta name='translated' content='2 December 2011'/> |
| 11 | <meta name='modified' content='20 October 2019'/> |
| 12 | <meta name='reference' content='originals/door_desired.wrl'/> |
| 13 | <meta name='reference' content=' Stocker_06_Followers.pdf '/> |
| 14 | <meta name='reference' content='http://www.hersto.com/Publications/Followers'/> |
| 15 | <meta name='requires' content='X3D version 3.2 or greater'/> |
| 16 | <meta name='subject' content='X3D Follower Chaser Damper'/> |
| 17 | <meta name=' warning ' content=' under development, instantReality works but BS Contact fails silently '/> |
| 18 | <meta name='reference' content=' https://www.web3d.org/x3d/specifications/ISO-IEC-19775-1.2-X3D-AbstractSpecification/Part01/components/followers.html '/> |
| 19 | <meta name='reference' content=' https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html '/> |
| 20 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Basic/Followers/originals/DoorDesired.x3d '/> |
| 21 | <meta name='generator' content=' Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html '/> |
| 22 | <meta name='generator' content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 23 | <meta name='license' content='../../license.html'/> |
| 24 | </head> |
| 25 | <Scene> |
| 26 | <WorldInfo title='DoorDesired.x3d'/> |
| 27 | <Background DEF='Bgnd' skyAngle='1.1 1.4 1.57' skyColor='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 View' fieldOfView='0.844' orientation='-0.0040 1.0 0.0030 0.439' position='3.163 1.65 5.877'/> |
| 29 | <Viewpoint description='from the top' fieldOfView='0.844' orientation='-0.979 -0.051 0.198 1.263' position='-1.216 9.189 2.77'/> |
| 30 | <Shape> |
| 31 | <Appearance> |
| 32 | <Material diffuseColor='0.0 0.0 0.0' emissiveColor='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='TchCyls' description='touch to activate'/> |
| 38 | <Transform translation='-1.25 1.0 0.0'> |
| 39 | |
| 40 | <Appearance> |
| 41 | <Material ambientIntensity='0.00333' diffuseColor='0.52 0.26 0.0' emissiveColor='0.24 0.0 0.0' shininess='0.12' specularColor='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 | |
| 51 | <Appearance> |
| 52 | <Material ambientIntensity='0.00333' diffuseColor='0.425 0.182 0.0075' emissiveColor='0.425 0.182 0.0075' shininess='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='TchDoor' description='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.334' emissiveColor='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='DmpODoor' duration='1.3' containerField='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='cOriOpen' type='SFRotation' value='0.0 -1.0 0.0 2.5' accessType='initializeOnly'/> |
| 77 | <field name='touched' type='SFTime' accessType='inputOnly'/> |
| 78 | <field name='IsOpen' type='SFBool' value='false' accessType='initializeOnly'/> |
| 79 | <field name='oriToGoTo' type='SFRotation' accessType='outputOnly'/> |
| 80 | <field name='cOriClosed' type='SFRotation' value='0.0 0.0 1.0 0.0' accessType='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 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 |
Worker
Script touched SFTime |
then
|
Worker
Script oriToGoTo SFRotation |
DmpODoor
OrientationChaser set_destination SFRotation |
then
|
DmpODoor
OrientationChaser value_changed SFRotation |
TransDoor
Transform rotation SFRotation |
|
TchDoor
TouchSensor touchTime SFTime |
Worker
Script touched SFTime |
then
|
Worker
Script oriToGoTo SFRotation |
DmpODoor
OrientationChaser set_destination SFRotation |
then
|
DmpODoor
OrientationChaser value_changed SFRotation |
TransDoor
Transform rotation SFRotation |
<!--
Color-coding 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)
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->