| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
|
| 3 | <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'> |
| 4 | <head> |
| 5 | <meta name='title' content=' KeySensorLefty.x3d '/> |
| 6 | <meta name='description' content='A KeySensor is used to change relative Viewpoints looking at the shark Lefty, while a SphereSensor can also rotate Lefty in place.'/> |
| 7 | <meta name='creator' content='Leonard Daly and Don Brutzman'/> |
| 8 | <meta name='created' content='10 June 2006'/> |
| 9 | <meta name='modified' content='20 October 2019'/> |
| 10 | <meta name='reference' content='https://X3dGraphics.com'/> |
| 11 | <meta name='reference' content=' https://www.web3d.org/x3d/content/examples/X3dResources.html '/> |
| 12 | <meta name='rights' content='Copyright 2006, Leonard Daly and Don Brutzman'/> |
| 13 | <meta name='subject' content='X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com'/> |
| 14 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/KeySensorLefty.x3d '/> |
| 15 | <meta name='generator' content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 16 | <meta name='license' content='../license.html'/> |
| 17 | </head> |
| 18 | <Scene> |
| 19 | <WorldInfo title='KeySensorLefty.x3d'/> |
| 20 | <Background skyColor='1 1 1'/> |
| 21 | <Group DEF='LeftyViewpointsUnrotated'> |
| 22 |
<!-- ROUTE information for View1 node:
[from KeyHandler.bind_View1 to set_bind
]
-->
<Viewpoint DEF='View1' description='Lefty from the Right'/> |
| 23 |
<!-- ROUTE information for View2 node:
[from KeyHandler.bind_View2 to set_bind
]
-->
<Viewpoint DEF='View2' description='Lefty from the Front' orientation='0 1 0 1.57' position='10 0 0'/> |
| 24 |
<!-- ROUTE information for View3 node:
[from KeyHandler.bind_View3 to set_bind
]
-->
<Viewpoint DEF='View3' description='Lefty from the Left' orientation='0 1 0 3.14' position='0 0 -10'/> |
| 25 |
<!-- ROUTE information for View4 node:
[from KeyHandler.bind_View4 to set_bind
]
-->
<Viewpoint DEF='View4' description='Lefty from Behind' orientation='0 1 0 -1.57' position='-10 0 0'/> |
| 26 |
<!-- ROUTE information for View5 node:
[from KeyHandler.bind_View5 to set_bind
]
-->
<Viewpoint DEF='View5' description='Lefty from the Top' orientation='1 0 0 -1.57' position='0 10 0'/> |
| 27 |
<!-- ROUTE information for View6 node:
[from KeyHandler.bind_View6 to set_bind
]
-->
<Viewpoint DEF='View6' description='Lefty from the Bottom' orientation='1 0 0 1.57' position='0 -10 0'/> |
| 28 | </Group> |
| 29 | <Transform translation='-2 2 0'> |
| 30 | <Billboard axisOfRotation='0 0 0'> |
| 31 | <Shape> |
| 32 | <Appearance> |
| 33 | <Material diffuseColor='0 0 0'/> |
| 34 | </Appearance> |
| 35 | <Text string='"Press 'n' key for next Viewpoint," "press 'p' key ppnnfor previous Viewpoint."'> |
| 36 | <FontStyle family='"SANS"' justify='"BEGIN" "BEGIN"' size='0.5'/> |
| 37 | </Text> |
| 38 | </Shape> |
| 39 | </Billboard> |
| 40 | </Transform> |
| 41 | <Transform DEF='OrientationControl' translation='2 -2 3'> |
| 42 |
<!-- ROUTE information for Rotator node:
[from rotation_changed to OrientationDisplay.rotation
]
[from rotation_changed to ReOrient.rotation
]
-->
<SphereSensor DEF='Rotator' description='Select and drag to rotate'/> |
| 43 |
<!-- ROUTE information for OrientationDisplay node:
[from Rotator.rotation_changed to rotation
]
-->
<Transform DEF='OrientationDisplay'> |
| 44 | <Shape> |
| 45 | <Appearance> |
| 46 | <Material diffuseColor='0 0 1'/> |
| 47 | </Appearance> |
| 48 | <Sphere radius='.5'/> |
| 49 | </Shape> |
| 50 | </Transform> |
| 51 | </Transform> |
| 52 | <Transform scale='3 3 3'> |
| 53 |
<!-- ROUTE information for ReOrient node:
[from Rotator.rotation_changed to rotation
]
-->
<Transform DEF='ReOrient'> |
| 54 | <Inline url=' "../KelpForestExhibit/SharkLefty.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/SharkLefty.x3d" "../KelpForestExhibit/SharkLefty.wrl" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/SharkLefty.wrl" '/> |
| 55 | </Transform> |
| 56 | </Transform> |
| 57 | < ROUTE fromNode='Rotator' fromField='rotation_changed' toNode='OrientationDisplay' toField='rotation'/> |
| 58 | < ROUTE fromNode='Rotator' fromField='rotation_changed' toNode='ReOrient' toField='rotation'/> |
| 59 |
<!-- ROUTE information for KeyDetector node:
[from keyPress to KeyHandler.keyPress
]
-->
<KeySensor DEF='KeyDetector'/> |
| 60 |
<!-- 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://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/KeySensorLeftyScript.js" '> |
| 61 | <field name='keyPress' type='SFString' accessType='inputOnly'/> |
| 62 | <field name='viewpointIndex' type='SFInt32' value='1' accessType='initializeOnly'/> |
| 63 | <field name='bind_View1' type='SFBool' accessType='outputOnly'/> |
| 64 | <field name='bind_View2' type='SFBool' accessType='outputOnly'/> |
| 65 | <field name='bind_View3' type='SFBool' accessType='outputOnly'/> |
| 66 | <field name='bind_View4' type='SFBool' accessType='outputOnly'/> |
| 67 | <field name='bind_View5' type='SFBool' accessType='outputOnly'/> |
| 68 | <field name='bind_View6' type='SFBool' accessType='outputOnly'/> |
| 69 | </Script> |
| 70 | < ROUTE fromNode='KeyDetector' fromField='keyPress' toNode='KeyHandler' toField='keyPress'/> |
| 71 | < ROUTE fromNode='KeyHandler' fromField='bind_View1' toNode='View1' toField='set_bind'/> |
| 72 | < ROUTE fromNode='KeyHandler' fromField='bind_View2' toNode='View2' toField='set_bind'/> |
| 73 | < ROUTE fromNode='KeyHandler' fromField='bind_View3' toNode='View3' toField='set_bind'/> |
| 74 | < ROUTE fromNode='KeyHandler' fromField='bind_View4' toNode='View4' toField='set_bind'/> |
| 75 | < ROUTE fromNode='KeyHandler' fromField='bind_View5' toNode='View5' toField='set_bind'/> |
| 76 | < ROUTE fromNode='KeyHandler' fromField='bind_View6' toNode='View6' toField='set_bind'/> |
| 77 | </Scene> |
| 78 | </X3D> |
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 |
OrientationDisplay
Transform rotation SFRotation |
|
|
Rotator
SphereSensor rotation_changed SFRotation |
ReOrient
Transform rotation SFRotation |
|
KeyDetector
KeySensor keyPress SFString |
KeyHandler
Script keyPress SFString |
then
|
KeyHandler
Script bind_View1 SFBool |
View1
Viewpoint set_bind SFBool |
||
|
then
|
KeyHandler
Script bind_View2 SFBool |
View2
Viewpoint set_bind SFBool |
||||
|
then
|
KeyHandler
Script bind_View3 SFBool |
View3
Viewpoint set_bind SFBool |
||||
|
then
|
KeyHandler
Script bind_View4 SFBool |
View4
Viewpoint set_bind SFBool |
||||
|
then
|
KeyHandler
Script bind_View5 SFBool |
View5
Viewpoint set_bind SFBool |
||||
|
then
|
KeyHandler
Script bind_View6 SFBool |
View6
Viewpoint set_bind SFBool |
||||
<!--
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.
-->