<?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://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/KeySensorLefty.x3d '/>
<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: KeyDetector, KeyHandler, LeftyViewpointsUnrotated, OrientationControl, OrientationDisplay, ReOrient, Rotator, View1, View2, View3, View4, View5, View6

Index for Viewpoint nodes: View1, View2, View3, View4, View5, View6
-->
<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=' Rotator' fromField='rotation_changed' toNode=' OrientationDisplay' toField='rotation'/>
< ROUTE  fromNode=' Rotator' fromField='rotation_changed' toNode=' ReOrient' toField='rotation'/>
<!-- ROUTE information for KeyDetector node:  [from keyPress to KeyHandler.keyPress ] -->
<KeySensor DEF='KeyDetector'/>

<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=' KeyDetector' fromField='keyPress' toNode=' KeyHandler' toField='keyPress'/>
< ROUTE  fromNode=' KeyHandler' fromField='bind_View1' toNode=' View1' toField='set_bind'/>
< ROUTE  fromNode=' KeyHandler' fromField='bind_View2' toNode=' View2' toField='set_bind'/>
< ROUTE  fromNode=' KeyHandler' fromField='bind_View3' toNode=' View3' toField='set_bind'/>
< ROUTE  fromNode=' KeyHandler' fromField='bind_View4' toNode=' View4' toField='set_bind'/>
< ROUTE  fromNode=' KeyHandler' fromField='bind_View5' toNode=' View5' toField='set_bind'/>
< ROUTE  fromNode=' KeyHandler' fromField='bind_View6' toNode=' View6' toField='set_bind'/>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: KeyDetector, KeyHandler, LeftyViewpointsUnrotated, OrientationControl, OrientationDisplay, ReOrient, Rotator, View1, View2, View3, View4, View5, View6

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

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

Rotator
SphereSensor
rotation_changed
SFRotation

ROUTE
event to
(1)
OrientationDisplay
Transform
rotation
SFRotation
Rotator
SphereSensor
rotation_changed
SFRotation

ROUTE
event to
(1)
ReOrient
Transform
rotation
SFRotation


KeyDetector
KeySensor
keyPress
SFString

ROUTE
event to
(1)
KeyHandler
Script
keyPress
SFString

 
 
then
KeyHandler
Script
bind_View1
SFBool

ROUTE
event to
(2)
View1
Viewpoint
set_bind
SFBool
 
 
 
then
KeyHandler
Script
bind_View2
SFBool

ROUTE
event to
(2)
View2
Viewpoint
set_bind
SFBool
 
 
 
then
KeyHandler
Script
bind_View3
SFBool

ROUTE
event to
(2)
View3
Viewpoint
set_bind
SFBool
 
 
 
then
KeyHandler
Script
bind_View4
SFBool

ROUTE
event to
(2)
View4
Viewpoint
set_bind
SFBool
 
 
 
then
KeyHandler
Script
bind_View5
SFBool

ROUTE
event to
(2)
View5
Viewpoint
set_bind
SFBool
 
 
 
then
KeyHandler
Script
bind_View6
SFBool

ROUTE
event to
(2)
View6
Viewpoint
set_bind
SFBool


-->

<!-- Online at
https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/KeySensorLeftyIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/KeySensorLefty.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. -->