X3D Model Documentation: SphereSensorLefty.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='SphereSensorLefty.x3d'/>
  6            <meta name='descriptioncontent='Using a separate SphereSensor, Lefty shark can be oriented in any direction by remote control. Navigation locked so that no other scene rotation is possible.'/>
  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=' warning content=' Xj3D not supporting SphereSensor autoOffset field correctly '/>
 11            <meta name='referencecontent='https://X3dGraphics.com'/>
 12            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/X3dResources.html'/>
 13            <meta name='rightscontent='Copyright 2006, Leonard Daly and Don Brutzman'/>
 14            <meta name='subjectcontent='X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com'/>
 15            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/SphereSensorLefty.x3d'/>
 16            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 17            <meta name='licensecontent='../license.html'/>
 18       </head>
<!--

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

<!-- to top Index for DEF nodes: LockUserSceneRotation, Rotator, SharkRotation, UserInterfaceRotation, UserInterfaceTranslation

Index for Viewpoint node: Viewpoint_1
-->
 19       <Scene>
 20            <WorldInfo title='SphereSensorLefty.x3d'/>
 21            <Background skyColor='1 1 1'/>
 22            <NavigationInfo DEF='LockUserSceneRotationtype='"NONE"'/>
 23            <Viewpoint description='Book Vieworientation='0 -1 0 0.05position='-0.06 -0.29 8.78'/>
 24            <Transform DEF='UserInterfaceTranslationtranslation='2 -2 3'>
 25                 <!-- Note that splitting the single Transform into two, and embedding SphereSensor here, shields it from affecting other nodes in scene -->
 26 
               <!-- ROUTE information for Rotator node:  [from rotation_changed to SharkRotation.rotation ] [from rotation_changed to UserInterfaceRotation.rotation ] -->
               <SphereSensor DEF='Rotatordescription='drag sphere to rotate Lefty'/>
 27                 <!-- this nested Transform allows rotation about the center of the local coordinate frame -->
 28 
               <!-- ROUTE information for UserInterfaceRotation node:  [from Rotator.rotation_changed to rotation ] -->
               <Transform DEF='UserInterfaceRotation'>
 29                      <Shape>
 30                           <Appearance>
 31                                <Material diffuseColor='0 0 1'/>
 32                           </Appearance>
 33                           <Sphere radius='.5'/>
 34                      </Shape>
 35                 </Transform>
 36            </Transform>
 37            <!-- note that the shark is translated to a different coordinate reference frame, so the SphereSensor is like a remote control -->
 38 
          <!-- ROUTE information for SharkRotation node:  [from Rotator.rotation_changed to rotation ] -->
          <Transform DEF='SharkRotationtranslation='0 0 7'>
 39                 <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" '/>
 40            </Transform>
 41            < ROUTE  fromNode='Rotator' fromField='rotation_changed' toNode='SharkRotation' toField='rotation'/>
 42            <!-- note that the shark will rotate without this ROUTE but that user interaction feels smoother and more natural -->
 43            < ROUTE  fromNode='Rotator' fromField='rotation_changed' toNode='UserInterfaceRotation' toField='rotation'/>
 44       </Scene>
 45  </X3D>
<!--

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

<!-- to top Index for DEF nodes: LockUserSceneRotation, Rotator, SharkRotation, UserInterfaceRotation, UserInterfaceTranslation

Index for Viewpoint node: Viewpoint_1
-->
X3D Tooltips element index: Appearance, Background, head, Inline, Material, meta, NavigationInfo, ROUTE, Scene, Shape, Sphere, SphereSensor, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

Event Graph ROUTE Table with 2 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)
SharkRotation
Transform
rotation
SFRotation
Rotator
SphereSensor
rotation_changed
SFRotation

ROUTE
event to
(1)
UserInterfaceRotation
Transform
rotation
SFRotation
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/SphereSensorLeftyIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/SphereSensorLefty.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. -->