X3D Model Documentation: KeySensorLefty.x3d

  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='titlecontent='KeySensorLefty.x3d'/>
  6            <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.'/>
  7            <meta name='creatorcontent='Leonard Daly and Don Brutzman'/>
  8            <meta name='createdcontent='10 June 2006'/>
  9            <meta name='modifiedcontent='20 October 2019'/>
 10            <meta name='referencecontent='https://X3dGraphics.com'/>
 11            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/X3dResources.html'/>
 12            <meta name='rightscontent='Copyright 2006, Leonard Daly and Don Brutzman'/>
 13            <meta name='subjectcontent='X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com'/>
 14            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/KeySensorLefty.x3d'/>
 15            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 16            <meta name='licensecontent='../license.html'/>
 17       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top 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
-->
 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='View1description='Lefty from the Right'/>
 23 
               <!-- 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'/>
 24 
               <!-- 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'/>
 25 
               <!-- 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'/>
 26 
               <!-- 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'/>
 27 
               <!-- 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'/>
 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='OrientationControltranslation='2 -2 3'>
 42 
               <!-- 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'/>
 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 
 61                 <field name='keyPresstype='SFStringaccessType='inputOnly'/>
 62                 <field name='viewpointIndextype='SFInt32value='1accessType='initializeOnly'/>
 63                 <field name='bind_View1type='SFBoolaccessType='outputOnly'/>
 64                 <field name='bind_View2type='SFBoolaccessType='outputOnly'/>
 65                 <field name='bind_View3type='SFBoolaccessType='outputOnly'/>
 66                 <field name='bind_View4type='SFBoolaccessType='outputOnly'/>
 67                 <field name='bind_View5type='SFBoolaccessType='outputOnly'/>
 68                 <field name='bind_View6type='SFBoolaccessType='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 shows event connections.
-->

<!-- to top 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
-->
X3D Tooltips element index: Appearance, Background, Billboard, field, FontStyle, Group, head, Inline, KeySensor, Material, meta, ROUTE, Scene, Script, Shape, Sphere, SphereSensor, Text, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

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
Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

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