X3D Model Documentation: HudControlPanelPrototype.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2 
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
  3  <X3D profile='Immersive' version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  4       <head>
  5            <meta name='titlecontent='HudControlPanelPrototype.x3d'/>
  6            <meta name='descriptioncontent='Prototype for a "heads-up" control panel. This node defines an object that maintains its orientation to the current viewpoint. Also present is a border that allows the panel to be dragged anywhere on the screen. All of the touchSensor events relating to texture maps are available as output events from this node.'/>
  7            <meta name='creatorcontent='Leonard Daly'/>
  8            <meta name='translatorcontent='Dan Kucik'/>
  9            <meta name='createdcontent='1999'/>
 10            <meta name='translatedcontent='8 June 2003'/>
 11            <meta name='modifiedcontent='28 November 2019'/>
 12            <meta name=' error content=' HUD does not sit still when navigating '/>
 13            <meta name='referencecontent='http://www.realism.com/Web3D/Examples/examples.cgi?ID=5'/>
 14            <meta name='rightscontent='This code may be reused in part or total. Please include this paragraph when it is used. Copyright 1999, Leonard Daly #****************'/>
 15            <meta name='subjectcontent='Heads-up display example'/>
 16            <meta name='referencecontent='Original VRML File: http://www.realism.com/vrml/Example/HUD/HUD_proto.wrl'/>
 17            <meta name='identifiercontent='https://savage.nps.edu/Savage/Tools/HeadsUpDisplays/HudControlPanelPrototype.x3d'/>
 18            <meta name='generatorcontent='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/>
 19            <meta name='generatorcontent='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit'/>
 20            <meta name='licensecontent='../../license.html'/>
 21       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: _IS_0, _IS_1, CtlPnlOffset, Main, MovePanel, MoveScript, Panel

Index for ProtoDeclare definition: HudControlPanel
-->
 22       <Scene>
 23            <WorldInfo title='HudControlPanelPrototype.x3d'/>
 24            <ProtoDeclare name='HudControlPanelappinfo='Heads Up Display (HUD) Control Panel'>
 25                 <ProtoInterface>
 26                      <field name='translationtype='SFVec3fvalue='0.0 0.0 -10.0accessType='initializeOnly'
                     appinfo='SFVec3f Position of the panel relative to the viewpoint. The X and Y components can be changed by dragging the window around.'/>
 27                      <field name='orientationtype='SFRotationvalue='0.0 1.0 0.0 0.0accessType='inputOutput'
                     appinfo='SFRotation This field should be the object of a ROUTE statement from the orientation_changed event from a ProximitySensor. For some reason the ProximitySensor does not correctly report the current viewpoint when the sensor is located inside of the PROTO.'/>
 28                      <field name='isOvertype='SFBoolaccessType='outputOnly'
                     appinfo='Out - SFBool event is generated when the cursor is over the texture mapped region of the control panel. Set to false when the cursor leaves the texture mapped region.'/>
 29                      <field name='hitTexCoord_changedtype='SFVec2faccessType='outputOnly'
                     appinfo='Out - SFVec2f The X/Y normalized coordinates (S and T) of the cursor location when isOver is true.'/>
 30                      <field name='borderColortype='SFColorvalue='0.6 0.6 0.6accessType='inputOutput'
                     appinfo='SFColor The color of the panel border. This is the region that can be used to drag the panel around the screen.'/>
 31                      <field name='scaletype='SFVec3fvalue='2.5 1.5 0.05accessType='initializeOnly'
                     appinfo='SFVec3f Size of the panel. The texture mapped area (see textureMap) is 95% in X and 90% in Y of this size.'/>
 32                      <field name='positiontype='SFVec3fvalue='0.0 0.0 0.0accessType='inputOutput'
                     appinfo='SFVec3f This field should be the object of a ROUTE statement from the position_changed event from a ProximitySensor. See orientation for more details.'/>
 33                      <field name='textureMaptype='MFStringaccessType='inputOutput'
                     appinfo='MFString The texture map URLs. This is specified in the same manner as the URL field in ImageTexture. The first one that can be loaded is the that is displayed. If this field is not specified then this region of the object is painted white.'/>
 34                      <field name='touchTimetype='SFTimeaccessType='outputOnly'
                     appinfo='Out - SFTime The time when a mouse button is released provided that the just prior to release isOver and isActive are true.'/>
 35                      <field name='isActivetype='SFBoolaccessType='outputOnly'
                     appinfo='Out - SFBool A true event is generated when the mouse button is depressed and the cursor is over the texture mapped region. A false event is generated when the button is released or when isOver becomes false.'/>
 36                 </ProtoInterface>
 37                 <ProtoBody>
 38                      <Transform DEF='Main'>
 39                           <IS>
 40                                <connect nodeField='translationprotoField='position'/>
 41                                <connect nodeField='rotationprotoField='orientation'/>
 42                           </IS>
 43 
                         <!-- ROUTE information for CtlPnlOffset node:  [from MoveScript.position to translation ] -->
                         <Transform DEF='CtlPnlOffset'>
 44                                <IS>
 45                                     <connect nodeField='translationprotoField='translation'/>
 46                                     <connect nodeField='scaleprotoField='scale'/>
 47                                </IS>
 48                                <DirectionalLight/>
 49 
                              <!-- ROUTE information for MovePanel node:  [from translation_changed to MoveScript.move ] -->
                              <PlaneSensor DEF='MovePaneldescription='Select item'/>
 50                                <Shape>
 51                                     <Appearance>
 52                                          <Material DEF='_IS_0'>
 53                                               <IS>
 54                                                    <connect nodeField='diffuseColorprotoField='borderColor'/>
 55                                               </IS>
 56                                          </Material>
 57                                     </Appearance>
 58 
                                   <!-- IndexedFaceSet Panel is a DEF node that has 1 USE node: USE_1 -->
                                   <IndexedFaceSet DEF='PanelcoordIndex='0 1 2 3 -1'>
 59                                          <Coordinate point='1.0 1.0 0.0 -1.0 1.0 0.0 -1.0 -1.0 0.0 1.0 -1.0 0.0'/>
 60                                     </IndexedFaceSet>
 61                                </Shape>
 62                                <Transform scale='0.95 0.9 1.0translation='0.0 0.0 0.01'>
 63                                     <TouchSensor description='Select item'>
 64                                          <IS>
 65                                               <connect nodeField='isOverprotoField='isOver'/>
 66                                               <connect nodeField='isActiveprotoField='isActive'/>
 67                                               <connect nodeField='hitTexCoord_changedprotoField='hitTexCoord_changed'/>
 68                                               <connect nodeField='touchTimeprotoField='touchTime'/>
 69                                          </IS>
 70                                     </TouchSensor>
 71                                     <Shape>
 72                                          <Appearance>
 73                                               <Material diffuseColor='1.0 1.0 1.0'/>
 74                                               <ImageTexture DEF='_IS_1'>
 75                                                    <IS>
 76                                                         <connect nodeField='urlprotoField='textureMap'/>
 77                                                    </IS>
 78                                               </ImageTexture>
 79                                          </Appearance>
 80                                          <IndexedFaceSet USE='Panel'/>
 81                                     </Shape>
 82                                </Transform>
 83                           </Transform>
 84                      </Transform>
 85 
                    <!-- ROUTE information for MoveScript node:  [from MovePanel.translation_changed to move ] [from position to CtlPnlOffset.translation ] -->
                    <Script DEF='MoveScript'>
 86                           <field name='positiontype='SFVec3faccessType='outputOnly'/>
 87                           <field name='movetype='SFVec3faccessType='inputOnly'/>
 88                           <field name='Iscaletype='SFVec3faccessType='initializeOnly'/>
 89                           <field name='Ioffsettype='SFVec3faccessType='initializeOnly'/>
 90                           <IS>
 91                                <connect nodeField='IscaleprotoField='scale'/>
 92                                <connect nodeField='IoffsetprotoField='translation'/>
 93                           </IS>
  <![CDATA[
          
ecmascript:

      function move (value)
      {
	position = new SFVec3f (Iscale[0] * value[0] + Ioffset[0],
                                Iscale[1] * value[1] + Ioffset[1],
                                Ioffset[2]);
      }

        
]]>
 95                      </Script>
 96                      < ROUTE  fromNode='MovePanel' fromField='translation_changed' toNode='MoveScript' toField='move'/>
 97                      < ROUTE  fromNode='MoveScript' fromField='position' toNode='CtlPnlOffset' toField='translation'/>
 98                 </ProtoBody>
 99            </ProtoDeclare>
100            <!-- ==================== -->
101            <Anchor description='HudControlPanel Exampleparameter='"target=_blank"'   url=' "HudControlPanelExample.x3d" "https://savage.nps.edu/Savage/Tools/HeadsUpDisplays/HudControlPanelExample.x3d" "HudControlPanelExample.wrl" "https://savage.nps.edu/Savage/Tools/HeadsUpDisplays/HudControlPanelExample.wrl" '>
102                 <Shape>
103                      <Appearance>
104                           <Material diffuseColor='0 1 1emissiveColor='0 1 1'/>
105                      </Appearance>
106                      <Text string='"HudControlPanelPrototype" "is a Prototype definition file." "" "To see an example scene" "using this new node" "click this text and view" "HudControlPanelExample"'>
107                           <FontStyle justify='"MIDDLE" "MIDDLE"size='0.8'/>
108                      </Text>
109                 </Shape>
110            </Anchor>
111       </Scene>
112  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: _IS_0, _IS_1, CtlPnlOffset, Main, MovePanel, MoveScript, Panel

Index for ProtoDeclare definition: HudControlPanel
-->
X3D Tooltips element index: Anchor, Appearance, connect, Coordinate, DirectionalLight, field, FontStyle, head, ImageTexture, IndexedFaceSet, IS, Material, meta, PlaneSensor, ProtoBody, ProtoDeclare, ProtoInterface, ROUTE, Scene, Script, Shape, Text, TouchSensor, Transform, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

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

line 63
TouchSensor
description='Select item' 
User-interaction hint for this node.(TouchSensor description is providing a tooltip)  

MovePanel
PlaneSensor
translation_changed
SFVec3f

ROUTE
event to
(1)
MoveScript
Script
move
SFVec3f
then
 
 
 
MoveScript
Script
position
SFVec3f

ROUTE
event to
(2)
CtlPnlOffset
Transform
translation
SFVec3f

line 101
Anchor
description='HudControlPanel Example' 
User-interaction hint for this node. 

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://savage.nps.edu/Savage/Tools/HeadsUpDisplays/HudControlPanelPrototypeIndex.html -->
<!-- Version control at
https://gitlab.nps.edu/Savage/Savage/Tools/HeadsUpDisplays/HudControlPanelPrototype.x3d -->

<!-- Color-coding legend: X3D terminology <X3dNode  DEF='idNamefield='value'/> matches XML terminology <XmlElement  DEF='idNameattribute='value'/>
(Light-blue background: event-based behavior node or statement) (Grey background inside box: inserted documentation) (Magenta background: X3D Extensibility)
    <ProtoDeclare name='ProtoName'> <field name='fieldName'/> </ProtoDeclare> -->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->