<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Immersive' version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' https://www.web3d.org/specifications/x3d-3.0.xsd '>
<head>
<meta name='titlecontent='Figure27_1VisibilitySensorDungeonSlidingDoors.x3d'/>
<meta name='creatorcontent='Figure 27.1, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/>
<meta name='referencecontent=' http://www.wiley.com/legacy/compbooks/vrml2sbk/ch27/27fig01.htm '/>
<meta name='translatorcontent='Don Brutzman'/>
<meta name='createdcontent='26 October 2000'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='Imagecontent='Figure27_1VisibilitySensorDungeonSlidingDoors.png'/>
<meta name='descriptioncontent="A dungeon door that slides open when visible, and slides closed when not visible. When you are look away from the door it goes shut, then it reopens when you look back. Page up/down between the first two viewpoints to observe this behavior. Arrow keys also help you peek left/right. Interesting side effect: users can't back up through the closed door."/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27SensingVisibilityProximityCollision/Figure27_1VisibilitySensorDungeonSlidingDoors.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!-- -->
<Scene>
<Viewpoint description='Now doors open, because they are visiblefieldOfView='1.05position='0 2 10'/>
<Viewpoint description='Now doors close, because they are not visiblefieldOfView='1.05orientation='0 1 0 -0.85position='0 2 5'/>
<NavigationInfo avatarSize='0.5 1.6 0.5headlight='falsespeed='2type='"WALK" "EXAMINE" "ANY"'/>
<Group>
<LOD range='20'> </LOD>
<Transform translation='0 0 -10'>
<LOD range='20'>
<Inline USE='DungeonRoom'/>
<WorldInfo info='"null node"'/>
</LOD>
</Transform>
<Transform translation='0 0 -5'> </Transform>
<Transform rotation='0 1 0 1.57scale='1 1 2translation='0 0 -15'> </Transform>
<Transform translation='0 0 -4.95'> </Transform>
<Sound maxBack='60maxFront='60minBack='20minFront='20'> </Sound>
<Sound maxBack='60maxFront='60minBack='20minFront='20'> </Sound>
<!-- ROUTE information for OpenClock node:  [from DoorSense.enterTime to set_startTime ] [from DoorSense.exitTime to set_stopTime ] [from fraction_changed to LeftOpen.set_fraction ] [from fraction_changed to RightOpen.set_fraction ] -->
<TimeSensor DEF='OpenClockcycleInterval='2'/>
<!-- ROUTE information for CloseClock node:  [from DoorSense.exitTime to set_startTime ] [from DoorSense.enterTime to set_stopTime ] [from fraction_changed to LeftClose.set_fraction ] [from fraction_changed to RightClose.set_fraction ] -->
<TimeSensor DEF='CloseClockcycleInterval='2'/>
<!-- ROUTE information for LeftOpen node:  [from OpenClock.fraction_changed to set_fraction ] [from value_changed to LeftDoor.set_translation ] -->
<PositionInterpolator DEF='LeftOpenkey='0 1keyValue='0 0 0 -1.3 0 0'/>
<!-- ROUTE information for LeftClose node:  [from CloseClock.fraction_changed to set_fraction ] [from value_changed to LeftDoor.set_translation ] -->
<PositionInterpolator DEF='LeftClosekey='0 1keyValue='-1.3 0 0 0 0 0'/>
<!-- ROUTE information for RightOpen node:  [from OpenClock.fraction_changed to set_fraction ] [from value_changed to RightDoor.set_translation ] -->
<PositionInterpolator DEF='RightOpenkey='0 1keyValue='0 0 0 1.3 0 0'/>
<!-- ROUTE information for RightClose node:  [from CloseClock.fraction_changed to set_fraction ] [from value_changed to RightDoor.set_translation ] -->
<PositionInterpolator DEF='RightClosekey='0 1keyValue='1.3 0 0 0 0 0'/>
</Group>
<!-- open door -->
<ROUTE fromNode='DoorSensefromField='enterTimetoNode='OpenSoundtoField='set_startTime'/>
<ROUTE fromNode='DoorSensefromField='exitTimetoNode='OpenSoundtoField='set_stopTime'/>
<ROUTE fromNode='DoorSensefromField='enterTimetoNode='OpenClocktoField='set_startTime'/>
<ROUTE fromNode='DoorSensefromField='exitTimetoNode='OpenClocktoField='set_stopTime'/>
<!-- close door -->
<ROUTE fromNode='DoorSensefromField='exitTimetoNode='CloseSoundtoField='set_startTime'/>
<ROUTE fromNode='DoorSensefromField='enterTimetoNode='CloseSoundtoField='set_stopTime'/>
<ROUTE fromNode='DoorSensefromField='exitTimetoNode='CloseClocktoField='set_startTime'/>
<ROUTE fromNode='DoorSensefromField='enterTimetoNode='CloseClocktoField='set_stopTime'/>
<!-- door timers -->
<ROUTE fromNode='OpenClockfromField='fraction_changedtoNode='LeftOpentoField='set_fraction'/>
<ROUTE fromNode='OpenClockfromField='fraction_changedtoNode='RightOpentoField='set_fraction'/>
<ROUTE fromNode='CloseClockfromField='fraction_changedtoNode='LeftClosetoField='set_fraction'/>
<ROUTE fromNode='CloseClockfromField='fraction_changedtoNode='RightClosetoField='set_fraction'/>
<!-- door translations -->
<ROUTE fromNode='LeftOpenfromField='value_changedtoNode='LeftDoortoField='set_translation'/>
<ROUTE fromNode='RightOpenfromField='value_changedtoNode='RightDoortoField='set_translation'/>
<ROUTE fromNode='LeftClosefromField='value_changedtoNode='LeftDoortoField='set_translation'/>
<ROUTE fromNode='RightClosefromField='value_changedtoNode='RightDoortoField='set_translation'/>
</Scene>
</X3D>
<!--

Index for DEF nodes : CloseClock, CloseSound, Door, DoorSense, DungeonRoom, LeftClose, LeftDoor, LeftOpen, OpenClock, OpenSound, RightClose, RightDoor, RightOpen

Index for Viewpoint images : Viewpoint_1, Viewpoint_2
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
-->

<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources and X3D Scene Authoring Hints. -->