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='SphereSensorLefty.x3d'/> |
6 | <meta name='description' content='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='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=' warning ' content=' Xj3D not supporting SphereSensor autoOffset field correctly '/> |
11 | <meta name='reference' content='https://X3dGraphics.com'/> |
12 | <meta name='reference' content='https://www.web3d.org/x3d/content/examples/X3dResources.html'/> |
13 | <meta name='rights' content='Copyright 2006, Leonard Daly and Don Brutzman'/> |
14 | <meta name='subject' content='X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com'/> |
15 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/SphereSensorLefty.x3d'/> |
16 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
17 | <meta name='license' content='../license.html'/> |
18 | </head> |
19 | <Scene> |
20 | <WorldInfo title='SphereSensorLefty.x3d'/> |
21 | <Background skyColor='1 1 1'/> |
22 | <NavigationInfo DEF='LockUserSceneRotation' type='"NONE"'/> |
23 | <Viewpoint description='Book View' orientation='0 -1 0 0.05' position='-0.06 -0.29 8.78'/> |
24 | <Transform DEF='UserInterfaceTranslation' translation='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='Rotator' description='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='SharkRotation' translation='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 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 |
SharkRotation
Transform rotation SFRotation |
|
Rotator
SphereSensor rotation_changed SFRotation |
UserInterfaceRotation
Transform rotation SFRotation |
<!--
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)
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->