<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.1//EN"   "http://www.web3d.org/specifications/x3d-3.1.dtd">
<X3D profile='Immersiveversion='3.1xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation=' http://www.web3d.org/specifications/x3d-3.1.xsd '>
<head>
<meta name='titlecontent='HudPrototype.x3d'/>
<meta name='descriptioncontent='Demonstrates use of a ProximitySensor in building a HUD'/>
<meta name='documentationcontent='A simple heads-up display (HUD) Prototype manages the display of a HUD and maintains its position on the screen. Changes to fieldOfView (in Viewpoint node) will change screen position Fields: hudSize Size of HUD (initializeOnly - SFVec3f) default="1 1 .01" hudColor Color of HUD (inputOutput - SFColor) default="1 1 1" screenOffset Offset of HUD. This field positions the HUD on the display screen (inputOutput - SFVec3f) default="0 0 0" hudGeometry Geometry to be placed on the HUD. Origin is center of HUD. (inputOutput - MFNode) default = [] position_changed Current viewer location (outputOnly - SFVec3f) orientation_changed Current viewer orientation (outputOnly - SFRotation)'/>
<meta name='creatorcontent='Leonard Daly and Don Brutzman'/>
<meta name='createdcontent='15 July 2006'/>
<meta name='modifiedcontent='1 April 2007'/>
<meta name='referencecontent=' http://X3dGraphics.com '/>
<meta name='referencecontent=' http://www.web3d.org/x3d/content/examples/help.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=' http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14-Prototypes/HudPrototype.x3d '/>
<meta name='generatorcontent='X3D-Edit, https://savage.nps.edu/X3D-Edit'/>
</head>
<!--

Index for ProtoDeclare definition: HUD
Index for DEF nodes: HereIAm, Hud, HudContainer
-->
<Scene>
<!-- Simple Heads-Up Display (HUD) Prototype\n \n Manages the display of a HUD and maintains its position on the screen.\n Changes to fieldOfView (in Viewpoint node) will change screen position\n \n Fields:\n hudSize Size of HUD (initializeOnly - SFVec3f) default="1 1 .01"\n hudColor Color of HUD (inputOutput - SFColor) default="1 1 1"\n screenOffset Offset of HUD. This field positions the HUD on the display screen (inputOutput - SFVec3f) default="0 0 0"\n hudGeometry Geometry to be placed on the HUD. Origin is center of HUD. (inputOutput - MFNode) default = []\n position_changed Current viewer location (outputOnly - SFVec3f)\n orientation_changed Current viewer orientation (outputOnly - SFRotation)\n \n \n -->
<ProtoDeclare name='HUD'>
<ProtoInterface>
<field name='hudSizetype='SFVec3fvalue='1 1 .01accessType='initializeOnly'/>
<field name='hudColortype='SFColorvalue='1 1 1accessType='inputOutput'/>
<field name='screenOffsettype='SFVec3fvalue='0 0 0accessType='inputOutput'/>
<field name='hudGeometrytype='MFNodeaccessType='inputOutput'/>
<field name='position_changedtype='SFVec3faccessType='outputOnly'/>
<field name='orientation_changedtype='SFRotationaccessType='outputOnly'/>
</ProtoInterface>
<ProtoBody>
<Group>
<!-- HudContainer ROUTEs:  [from HereIAm.orientation_changed to rotation ] [from HereIAm.position_changed to translation ] -->
<Transform DEF='HudContainer'>
<Transform>
<IS>
<connect nodeField='translationprotoField='screenOffset'/>
</IS>
<Shape>
<Appearance>
<Material>
<IS>
<connect nodeField='diffuseColorprotoField='hudColor'/>
</IS>
</Material>
</Appearance>
<Box size='1.5 .4 .1'>
<IS>
<connect nodeField='sizeprotoField='hudSize'/>
</IS>
</Box>
</Shape>
<Group>
<IS>
<connect nodeField='childrenprotoField='hudGeometry'/>
</IS>
</Group>
</Transform>
</Transform>
<!-- HereIAm ROUTEs:  [from orientation_changed to HudContainer.rotation ] [from position_changed to HudContainer.translation ] -->
<ProximitySensor DEF='HereIAmsize='1000 1000 1000'>
<IS>
<connect nodeField='position_changedprotoField='position_changed'/>
<connect nodeField='orientation_changedprotoField='orientation_changed'/>
</IS>
</ProximitySensor>
<ROUTE fromNode='HereIAmfromField='orientation_changedtoNode='HudContainertoField='rotation'/>
<ROUTE fromNode='HereIAmfromField='position_changedtoNode='HudContainertoField='translation'/>
</Group>
</ProtoBody>
</ProtoDeclare>
<ProtoInstance name='HUDDEF='HudcontainerField='children'>
<fieldValue name='hudSizevalue='1.5 .4 .1'/>
<fieldValue name='hudColorvalue='1 1 0'/>
<fieldValue name='screenOffsetvalue='-.8 1. -3'/>
</ProtoInstance>
</Scene>
</X3D>
<!--

Index for ProtoDeclare definition: HUD
Index for DEF nodes: HereIAm, Hud, HudContainer
-->

<!-- Tag color codes: <Node DEF='idName' attribute='value'/> <Prototype name='ProtoName'> <field name='fieldName'/> </Prototype> -->