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='title' content='HudControlPanelPrototype.x3d'/> |
6 | <meta name='description' content='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='creator' content='Leonard Daly'/> |
8 | <meta name='translator' content='Dan Kucik'/> |
9 | <meta name='created' content='1999'/> |
10 | <meta name='translated' content='8 June 2003'/> |
11 | <meta name='modified' content='28 November 2019'/> |
12 | <meta name=' error ' content=' HUD does not sit still when navigating '/> |
13 | <meta name='reference' content='http://www.realism.com/Web3D/Examples/examples.cgi?ID=5'/> |
14 | <meta name='rights' content='This code may be reused in part or total. Please include this paragraph when it is used. Copyright 1999, Leonard Daly #****************'/> |
15 | <meta name='subject' content='Heads-up display example'/> |
16 | <meta name='reference' content='Original VRML File: http://www.realism.com/vrml/Example/HUD/HUD_proto.wrl'/> |
17 | <meta name='identifier' content='https://savage.nps.edu/Savage/Tools/HeadsUpDisplays/HudControlPanelPrototype.x3d'/> |
18 | <meta name='generator' content='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/> |
19 | <meta name='generator' content='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit'/> |
20 | <meta name='license' content='../../license.html'/> |
21 | </head> |
22 | <Scene> |
23 | <WorldInfo title='HudControlPanelPrototype.x3d'/> |
24 | <ProtoDeclare name='HudControlPanel' appinfo='Heads Up Display (HUD) Control Panel'> |
25 | <ProtoInterface> |
26 |
<field name='translation' type='SFVec3f' value='0.0 0.0 -10.0' accessType='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='orientation' type='SFRotation' value='0.0 1.0 0.0 0.0' accessType='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='isOver' type='SFBool' accessType='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_changed' type='SFVec2f' accessType='outputOnly'
appinfo='Out - SFVec2f The X/Y normalized coordinates (S and T) of the cursor location when isOver is true.'/> |
30 |
<field name='borderColor' type='SFColor' value='0.6 0.6 0.6' accessType='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='scale' type='SFVec3f' value='2.5 1.5 0.05' accessType='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='position' type='SFVec3f' value='0.0 0.0 0.0' accessType='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='textureMap' type='MFString' accessType='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='touchTime' type='SFTime' accessType='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='isActive' type='SFBool' accessType='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='translation' protoField='position'/> |
41 | <connect nodeField='rotation' protoField='orientation'/> |
42 | </IS> |
43 |
<!-- ROUTE information for CtlPnlOffset node:
[from MoveScript.position to translation
]
-->
<Transform DEF='CtlPnlOffset'> |
44 | <IS> |
45 | <connect nodeField='translation' protoField='translation'/> |
46 | <connect nodeField='scale' protoField='scale'/> |
47 | </IS> |
48 | <DirectionalLight/> |
49 |
<!-- ROUTE information for MovePanel node:
[from translation_changed to MoveScript.move
]
-->
<PlaneSensor DEF='MovePanel' description='Select item'/> |
50 | <Shape> |
51 | <Appearance> |
52 | <Material DEF='_IS_0'> |
53 | <IS> |
54 | <connect nodeField='diffuseColor' protoField='borderColor'/> |
55 | </IS> |
56 | </Material> |
57 | </Appearance> |
58 | |
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.0' translation='0.0 0.0 0.01'> |
63 | <TouchSensor description='Select item'> |
64 | <IS> |
65 | <connect nodeField='isOver' protoField='isOver'/> |
66 | <connect nodeField='isActive' protoField='isActive'/> |
67 | <connect nodeField='hitTexCoord_changed' protoField='hitTexCoord_changed'/> |
68 | <connect nodeField='touchTime' protoField='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='url' protoField='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='position' type='SFVec3f' accessType='outputOnly'/> |
87 | <field name='move' type='SFVec3f' accessType='inputOnly'/> |
88 | <field name='Iscale' type='SFVec3f' accessType='initializeOnly'/> |
89 | <field name='Ioffset' type='SFVec3f' accessType='initializeOnly'/> |
90 | <IS> |
91 | <connect nodeField='Iscale' protoField='scale'/> |
92 | <connect nodeField='Ioffset' protoField='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 Example' parameter='"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 1' emissiveColor='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 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 |
MoveScript
Script move SFVec3f |
then
|
MoveScript
Script position SFVec3f |
CtlPnlOffset
Transform translation SFVec3f |
line 101
Anchor |
description='HudControlPanel Example' User-interaction hint for this node. |
<!--
Color-coding 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)
<ProtoDeclare name='ProtoName'>
<field
name='fieldName'/> </ProtoDeclare>
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->