X3D Model Documentation: ProximitySensorExample.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='ProximitySensorExample.x3d'/>
  6            <meta name='descriptioncontent='Demonstrates use of a ProximitySensor in building a HUD'/>
  7            <meta name='creatorcontent='Leonard Daly and Don Brutzman'/>
  8            <meta name='createdcontent='15 July 2006'/>
  9            <meta name='modifiedcontent='27 July 2024'/>
 10            <meta name='Imagecontent='ProximitySensorVisualization.png'/>
 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, Daly Realism 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/Chapter12EnvironmentSensorSound/ProximitySensorExample.x3d'/>
 16            <meta name='generatorcontent='X3D-Edit 4.0, 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: BottomText, BottomTextLine, CnvText, HereIAm, HUD, HudContents, PushBack, Text_app, TextStyle, TopText, TopTextLine
-->
 19       <Scene>
 20            <!-- HUD = Heads-Up Display, which stays on screen in same relative location even while user navigates -->
 21            <!-- TODO: authors should use X3D-Edit editing pane to try out the ProximitySensor Visualize capability -->
 22            <WorldInfo title='ProximitySensorExample.x3d'/>
 23 
          <!-- ROUTE information for HereIAm node:  [from orientation_changed to HUD.rotation ] [from position_changed to HUD.translation ] [from position_changed to CnvText.position ] [from orientation_changed to CnvText.orientation ] -->
          <ProximitySensor DEF='HereIAmsize='100 100 100'/>
 24            <Inline   url=' "../KelpForestExhibit/KelpForestMain.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/KelpForestMain.x3d" "../KelpForestExhibit/KelpForestMain.wrl" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/KelpForestMain.wrl" '/>
 25 
          <!-- ROUTE information for HUD node:  [from HereIAm.orientation_changed to rotation ] [from HereIAm.position_changed to translation ] -->
          <Transform DEF='HUD'>
 26                 <Transform DEF='PushBacktranslation='-.8 1. -3'>
 27                      <Shape>
 28                           <Appearance>
 29                                <Material diffuseColor='1 1 0'/>
 30                           </Appearance>
 31                           <Box size='1.5 .4 .1'/>
 32                      </Shape>
 33                      <Transform DEF='HudContentstranslation='-.7 .3 .1'>
 34                           <Transform DEF='TopTexttranslation='0 -.2 0'>
 35                                <Shape>
 36 
                                   <!-- Appearance Text_app is a DEF node that has 1 USE node: USE_1 -->
                                   <Appearance DEF='Text_app'>
 37                                          <Material diffuseColor='0 0 0'/>
 38                                     </Appearance>
 39 
                                   <!-- ROUTE information for TopTextLine node:  [from CnvText.positionText to string ] -->
                                   <Text DEF='TopTextLinestring='"Position 0.00 0.00 10.00"'>
 40 
                                        <!-- FontStyle TextStyle is a DEF node that has 1 USE node: USE_1 -->
                                        <FontStyle DEF='TextStylefamily='"SANS" "SERIF"justify='"BEGIN" "BEGIN"size='0.1'/>
 41                                     </Text>
 42                                </Shape>
 43                           </Transform>
 44                           <Transform DEF='BottomTexttranslation='0 -.4 0'>
 45                                <Shape>
 46                                     <Appearance USE='Text_app'/>
 47 
                                   <!-- ROUTE information for BottomTextLine node:  [from CnvText.orientationText to string ] -->
                                   <Text DEF='BottomTextLinestring='"Orientation: 0.000 1.000 0.000 0.00"'>
 48                                          <FontStyle USE='TextStyle'/>
 49                                     </Text>
 50                                </Shape>
 51                           </Transform>
 52                      </Transform>
 53                 </Transform>
 54            </Transform>
 55 
 56                 <field name='positiontype='SFVec3faccessType='inputOnly'/>
 57                 <field name='orientationtype='SFRotationaccessType='inputOnly'/>
 58                 <field name='positionTexttype='MFStringaccessType='outputOnly'/>
 59                 <field name='orientationTexttype='MFStringaccessType='outputOnly'/>
 60            </Script>
 61            < ROUTE  fromNode='HereIAm' fromField='orientation_changed' toNode='HUD' toField='rotation'/>
 62            < ROUTE  fromNode='HereIAm' fromField='position_changed' toNode='HUD' toField='translation'/>
 63            < ROUTE  fromNode='HereIAm' fromField='position_changed' toNode='CnvText' toField='position'/>
 64            < ROUTE  fromNode='HereIAm' fromField='orientation_changed' toNode='CnvText' toField='orientation'/>
 65            < ROUTE  fromNode='CnvText' fromField='positionText' toNode='TopTextLine' toField='string'/>
 66            < ROUTE  fromNode='CnvText' fromField='orientationText' toNode='BottomTextLine' toField='string'/>
 67       </Scene>
 68  </X3D>
<!--

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

<!-- to top Index for DEF nodes: BottomText, BottomTextLine, CnvText, HereIAm, HUD, HudContents, PushBack, Text_app, TextStyle, TopText, TopTextLine
-->
X3D Tooltips element index: Appearance, Box, field, FontStyle, head, Inline, Material, meta, ProximitySensor, ROUTE, Scene, Script, Shape, Text, Transform, WorldInfo, X3D, accessType and type, XML data types, field types

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

HereIAm
ProximitySensor
orientation_changed
SFRotation

ROUTE
event to
(1)
HUD
Transform
rotation
SFRotation
HereIAm
ProximitySensor
position_changed
SFVec3f

ROUTE
event to
(1)
HUD
Transform
translation
SFVec3f
HereIAm
ProximitySensor
position_changed
SFVec3f

ROUTE
event to
(1)
CnvText
Script
position
SFVec3f
then
 
 
 
CnvText
Script
orientationText
MFString

ROUTE
event to
(2)
BottomTextLine
Text
string
MFString
  then
 
 
 
CnvText
Script
positionText
MFString

ROUTE
event to
(2)
TopTextLine
Text
string
MFString
HereIAm
ProximitySensor
orientation_changed
SFRotation

ROUTE
event to
(1)
CnvText
Script
orientation
SFRotation
then
 
 
 
CnvText
Script
orientationText
MFString

ROUTE
event to
(2)
BottomTextLine
Text
string
MFString
  then
 
 
 
CnvText
Script
positionText
MFString

ROUTE
event to
(2)
TopTextLine
Text
string
MFString
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/Chapter12EnvironmentSensorSound/ProximitySensorExampleIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/ProximitySensorExample.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. -->