<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<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 '>
<head>
<meta name='titlecontent='KeySensorLefty.x3d'/>
<meta name='descriptioncontent='A KeySensor is used to change relative Viewpoints looking at the shark Lefty, while a SphereSensor can also rotate Lefty in place.'/>
<meta name='creatorcontent='Leonard Daly and Don Brutzman'/>
<meta name='createdcontent='10 June 2006'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='referencecontent=' https://X3dGraphics.com '/>
<meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/X3dResources.html '/>
<meta name='rightscontent='Copyright 2006, Leonard Daly and Don Brutzman'/>
<meta name='subjectcontent=' X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com '/>
<meta name='identifiercontent=' https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter08UserInteractivity/KeySensorLefty.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!-- -->
<Scene>
<WorldInfo title='KeySensorLefty.x3d'/>
<Background skyColor='1 1 1'/>
<Group DEF='LeftyViewpointsUnrotated'>
<!-- ROUTE information for View1 node:  [from KeyHandler.bind_View1 to set_bind ] -->
<Viewpoint DEF='View1description='Lefty from the Right'/>
<!-- ROUTE information for View2 node:  [from KeyHandler.bind_View2 to set_bind ] -->
<Viewpoint DEF='View2description='Lefty from the Frontorientation='0 1 0 1.57position='10 0 0'/>
<!-- ROUTE information for View3 node:  [from KeyHandler.bind_View3 to set_bind ] -->
<Viewpoint DEF='View3description='Lefty from the Leftorientation='0 1 0 3.14position='0 0 -10'/>
<!-- ROUTE information for View4 node:  [from KeyHandler.bind_View4 to set_bind ] -->
<Viewpoint DEF='View4description='Lefty from Behindorientation='0 1 0 -1.57position='-10 0 0'/>
<!-- ROUTE information for View5 node:  [from KeyHandler.bind_View5 to set_bind ] -->
<Viewpoint DEF='View5description='Lefty from the Toporientation='1 0 0 -1.57position='0 10 0'/>
<!-- ROUTE information for View6 node:  [from KeyHandler.bind_View6 to set_bind ] -->
<Viewpoint DEF='View6description='Lefty from the Bottomorientation='1 0 0 1.57position='0 -10 0'/>
</Group>
<Transform translation='-2 2 0'>
<Billboard axisOfRotation='0 0 0'>
<Shape>
<Appearance>
<Material diffuseColor='0 0 0'/>
</Appearance>
<Text string='"Press 'n' key for next Viewpoint," "press 'p' key ppnnfor previous Viewpoint."'>
<FontStyle family='"SANS"justify='"BEGIN" "BEGIN"size='0.5'/>
</Text>
</Shape>
</Billboard>
</Transform>
<Transform DEF='OrientationControltranslation='2 -2 3'>
<!-- ROUTE information for Rotator node:  [from rotation_changed to OrientationDisplay.rotation ] [from rotation_changed to ReOrient.rotation ] -->
<SphereSensor DEF='Rotatordescription='Select and drag to rotate'/>
<!-- ROUTE information for OrientationDisplay node:  [from Rotator.rotation_changed to rotation ] -->
<Transform DEF='OrientationDisplay'>
<Shape>
<Appearance>
<Material diffuseColor='0 0 1'/>
</Appearance>
<Sphere radius='.5'/>
</Shape>
</Transform>
</Transform>
<Transform scale='3 3 3'> </Transform>
<ROUTE fromNode='RotatorfromField='rotation_changedtoNode='OrientationDisplaytoField='rotation'/>
<ROUTE fromNode='RotatorfromField='rotation_changedtoNode='ReOrienttoField='rotation'/>
<!-- ROUTE information for KeyDetector node:  [from keyPress to KeyHandler.keyPress ] -->
<KeySensor DEF='KeyDetector'/>
<!-- ROUTE information for KeyHandler node:  [from KeyDetector.keyPress to keyPress ] [from bind_View1 to View1.set_bind ] [from bind_View2 to View2.set_bind ] [from bind_View3 to View3.set_bind ] [from bind_View4 to View4.set_bind ] [from bind_View5 to View5.set_bind ] [from bind_View6 to View6.set_bind ] -->
<Script DEF='KeyHandler'
  url=' "KeySensorLeftyScript.js" "https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter08UserInteractivity/KeySensorLeftyScript.js" '>
<field name='keyPresstype='SFStringaccessType='inputOnly'/>
<field name='viewpointIndextype='SFInt32value='1accessType='initializeOnly'/>
<field name='bind_View1type='SFBoolaccessType='outputOnly'/>
<field name='bind_View2type='SFBoolaccessType='outputOnly'/>
<field name='bind_View3type='SFBoolaccessType='outputOnly'/>
<field name='bind_View4type='SFBoolaccessType='outputOnly'/>
<field name='bind_View5type='SFBoolaccessType='outputOnly'/>
<field name='bind_View6type='SFBoolaccessType='outputOnly'/>
</Script>
<ROUTE fromNode='KeyDetectorfromField='keyPresstoNode='KeyHandlertoField='keyPress'/>
<ROUTE fromNode='KeyHandlerfromField='bind_View1toNode='View1toField='set_bind'/>
<ROUTE fromNode='KeyHandlerfromField='bind_View2toNode='View2toField='set_bind'/>
<ROUTE fromNode='KeyHandlerfromField='bind_View3toNode='View3toField='set_bind'/>
<ROUTE fromNode='KeyHandlerfromField='bind_View4toNode='View4toField='set_bind'/>
<ROUTE fromNode='KeyHandlerfromField='bind_View5toNode='View5toField='set_bind'/>
<ROUTE fromNode='KeyHandlerfromField='bind_View6toNode='View6toField='set_bind'/>
</Scene>
</X3D>
<!--

Index for DEF nodes : KeyDetector, KeyHandler, LeftyViewpointsUnrotated, OrientationControl, OrientationDisplay, ReOrient, Rotator, View1, View2, View3, View4, View5, View6

Index for Viewpoint images : View1, View2, View3, View4, View5, View6
-->

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