<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<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 ' >
<head>
<meta name='titlecontent=' ProximitySensorExample.x3d '/>
<meta name='descriptioncontent='Demonstrates use of a ProximitySensor in building a HUD'/>
<meta name='creatorcontent='Leonard Daly and Don Brutzman'/>
<meta name='createdcontent='15 July 2006'/>
<meta name='modifiedcontent='14 June 2020'/>
<meta name='Imagecontent='ProximitySensorVisualization.png' />
<meta name='referencecontent=' https://X3dGraphics.com '/>
<meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/X3dResources.html '/>
<meta name='rightscontent='Copyright 2006, Daly Realism and Don Brutzman'/>
<meta name='subjectcontent=' X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com '/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/ProximitySensorExample.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: BottomText, BottomTextLine, CnvText, HereIAm, HUD, HudContents, PushBack, Text_app, TextStyle, TopText, TopTextLine
-->
<Scene>
<!-- HUD = Heads-Up Display, which stays on screen in same relative location even while user navigates -->
<!-- TODO: authors should use X3D-Edit editing pane to try out the ProximitySensor Visualize capability -->
<WorldInfo title='ProximitySensor.x3d'/>

<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" ' />

<!-- ROUTE information for HUD node:  [from HereIAm.orientation_changed to rotation ] [from HereIAm.position_changed to translation ] -->
<Transform DEF='HUD'>
<Transform DEF='PushBacktranslation='-.8 1. -3'>
<Shape>
<Appearance>
<Material diffuseColor='1 1 0'/>
</Appearance>
<Box size='1.5 .4 .1'/>
</Shape>
<Transform DEF='HudContentstranslation='-.7 .3 .1'>
<Transform DEF='TopTexttranslation='0 -.2 0'>
<Shape>
<Appearance DEF='Text_app'>
<Material diffuseColor='0 0 0'/>
</Appearance>
<!-- ROUTE information for TopTextLine node:  [from CnvText.positionText to string ] -->
<Text DEF='TopTextLinestring='"Position 0.00 0.00 10.00"'>
<FontStyle DEF='TextStylefamily='"SANS" "SERIF"justify='"BEGIN" "BEGIN"size='0.1'/>
</Text>
</Shape>
</Transform>
<Transform DEF='BottomTexttranslation='0 -.4 0'>
<Shape>
<Appearance USE=' Text_app'/>
<!-- ROUTE information for BottomTextLine node:  [from CnvText.orientationText to string ] -->
<Text DEF='BottomTextLinestring='"Orientation: 0.000 1.000 0.000 0.00"'>
<FontStyle USE=' TextStyle'/>
</Text>
</Shape>
</Transform>
</Transform>
</Transform>
</Transform>
<field name='positiontype='SFVec3faccessType='inputOnly'/>
<field name='orientationtype='SFRotationaccessType='inputOnly'/>
<field name='positionTexttype='MFStringaccessType='outputOnly'/>
<field name='orientationTexttype='MFStringaccessType='outputOnly'/>
</Script>
< ROUTE  fromNode=' HereIAm' fromField='orientation_changed' toNode=' HUD' toField='rotation'/>
< ROUTE  fromNode=' HereIAm' fromField='position_changed' toNode=' HUD' toField='translation'/>
< ROUTE  fromNode=' HereIAm' fromField='position_changed' toNode=' CnvText' toField='position'/>
< ROUTE  fromNode=' HereIAm' fromField='orientation_changed' toNode=' CnvText' toField='orientation'/>
< ROUTE  fromNode=' CnvText' fromField='positionText' toNode=' TopTextLine' toField='string'/>
< ROUTE  fromNode=' CnvText' fromField='orientationText' toNode=' BottomTextLine' toField='string'/>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: BottomText, BottomTextLine, CnvText, HereIAm, HUD, HudContents, PushBack, Text_app, TextStyle, TopText, TopTextLine
-->

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


-->

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