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='TSSRPairPrototype.x3d'/> |
6 | <meta name='description' content='A pair of Tropo Satellite Support Radios (TSSR) used for short-range (< 20 miles) point-to-point SHF communication. The system designed to support remote equipment and users by replacing long cable runs.'/> |
7 | <meta name='creator' content='Mike Hunsberger'/> |
8 | <meta name='created' content='1 May 2001'/> |
9 | <meta name='modified' content='20 October 2019'/> |
10 | <meta name='identifier' content='https://savage.nps.edu/Savage/CommunicationsAndSensors/TSSR/TSSRPairPrototype.x3d'/> |
11 | <meta name='reference' content='https://savage.nps.edu/Savage/CommunicationsAndSensors/TSSR/TSSRPairExample.x3d'/> |
12 | <meta name='generator' content='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit'/> |
13 | <meta name='license' content='../../license.html'/> |
14 | </head> |
15 | <Scene> |
16 | <ExternProtoDeclare name='BeamCylinder' appinfo='Produce wireframe or transparent beam cylinders. Typical uses include propeller/thruster water flow or line-of-sight sonar/radar/light beams. Negative range values invert base and apex at same relative location. Default: beam with apex at (0 0 0) and base of radius 1 in x-z plane at (1 0 0).' url=' "../../CommunicationsAndSensors/Beam/BeamCylinderPrototype.x3d#BeamCylinder" "https://savage.nps.edu/Savage/CommunicationsAndSensors/Beam/BeamCylinderPrototype.x3d#BeamCylinder" "../../CommunicationsAndSensors/Beam/BeamCylinderPrototype.wrl#BeamCylinder" "https://savage.nps.edu/Savage/CommunicationsAndSensors/Beam/BeamCylinderPrototype.wrl#BeamCylinder" '> |
17 |
<field name='name' type='SFString' accessType='initializeOnly'
appinfo='Assigning a name to a BeamCylinder aids tracing'/> |
18 |
<field name='contact' type='SFBool' accessType='inputOnly'
appinfo='(communications) is transmitted signal in contact with receiver or (sensor) is a target return detected?'/> |
19 |
<field name='range' type='SFFloat' accessType='inputOnly'
appinfo='distance in meters along x axis'/> |
20 |
<field name='defaultRange' type='SFFloat' accessType='initializeOnly'
appinfo='distance in meters used until eventIn range sent'/> |
21 |
<field name='wireframe' type='SFBool' accessType='initializeOnly'
appinfo='whether wireframe beam is drawn'/> |
22 |
<field name='solid' type='SFBool' accessType='initializeOnly'
appinfo='whether solid beam is drawn'/> |
23 |
<field name='beamHeight' type='SFFloat' accessType='initializeOnly'
appinfo='meters across vertical y axis'/> |
24 |
<field name='beamWidth' type='SFFloat' accessType='initializeOnly'
appinfo='meters across horizontal z axis'/> |
25 |
<field name='contactColor' type='SFColor' accessType='initializeOnly'
appinfo='rendering color when contact=true'/> |
26 |
<field name='noContactColor' type='SFColor' accessType='initializeOnly'
appinfo='rendering color when contact=false'/> |
27 |
<field name='transparency' type='SFFloat' accessType='inputOutput'
appinfo='1 = fully transparent wireframe only'/> |
28 | </ExternProtoDeclare> |
29 | <!-- ExternProtoDeclare definitions must be included verbatim --> |
30 | <!-- PROTO consists of two TSSRs for short range (< 5 mile) point-to-point communication. TSSRs eliminate the need for long cable runs. This PROTO allow specification for the initial placement of each TSSR. It automatically calculates the correct angle to complete the link. --> |
31 | <ProtoDeclare name='TSSRPair'> |
32 | <ProtoInterface> |
33 | <field name='TSSR1Location' type='SFVec3f' value='1 1 1' accessType='initializeOnly'/> |
34 | <field name='TSSR2Location' type='SFVec3f' value='0 0 0' accessType='initializeOnly'/> |
35 | </ProtoInterface> |
36 | <ProtoBody> |
37 | <Group> |
38 |
<!-- ROUTE information for TSSRPairViewpoint node:
[from CalculateAngleScript.ViewpointLocation to position
]
[from CalculateAngleScript.ViewpointAngle to orientation
]
-->
<Viewpoint DEF='TSSRPairViewpoint' description='TSSR Pair Viewpoint'/> |
39 | <LOD range='40000'> |
40 | <!-- TSSR 1 Two Transforms. One in the XZ plane, the second in the XY plane. Inlines for the TSSR body, stand, and the dome pattern. --> |
41 |
<!-- ROUTE information for TSSR1_TRANSFORM node:
[from CalculateAngleScript.TSSR1_XZangle to rotation
]
-->
<Transform DEF='TSSR1_TRANSFORM'> |
42 | <IS> |
43 | <connect nodeField='translation' protoField='TSSR1Location'/> |
44 | </IS> |
45 |
<!-- ROUTE information for TSSR1_XY_TRANSFORM node:
[from CalculateAngleScript.TSSR1_XYangle to rotation
]
-->
<Transform DEF='TSSR1_XY_TRANSFORM'> |
46 |
<!-- Inline
TSSRBody is a DEF node that has 1 USE node: USE_1 --> <Inline DEF='TSSRBody' url=' "../../CommunicationsAndSensors/TSSR/TSSRBody.x3d" "https://savage.nps.edu/Savage/CommunicationsAndSensors/TSSR/TSSRBody.x3d" "../../CommunicationsAndSensors/TSSR/TSSRBody.wrl" "https://savage.nps.edu/Savage/CommunicationsAndSensors/TSSR/TSSRBody.wrl" '/> |
47 | <Transform DEF='TSSR1Cone' translation='1 0 0'> |
48 |
<!-- ROUTE information for TSSR1_BEAMCYLINDER node:
[from CalculateAngleScript.beamLength to range
]
[from CalculateAngleScript.LinkEstablished to contact
]
-->
<ProtoInstance name='BeamCylinder' DEF='TSSR1_BEAMCYLINDER'> |
49 | <fieldValue name='defaultRange' value='10'/> |
50 | <fieldValue name='beamHeight' value='1'/> |
51 | <fieldValue name='beamWidth' value='1'/> |
52 | <fieldValue name='transparency' value='0.2'/> |
53 | <fieldValue name='wireframe' value='true'/> |
54 | <fieldValue name='solid' value='true'/> |
55 | <fieldValue name='contactColor' value='.3 .5 .5'/> |
56 | <fieldValue name='noContactColor' value='.8 .1 .1'/> |
57 | </ProtoInstance> |
58 | <LOD range='100'> |
59 | <Transform> |
60 | <Viewpoint description='TSSR1 side view'/> |
61 | </Transform> |
62 | <WorldInfo info='"null node for no rendering when distant"'/> |
63 | </LOD> |
64 | </Transform> |
65 | </Transform> |
66 | <Transform> |
67 |
<!-- Inline
TSSRStand is a DEF node that has 1 USE node: USE_1 --> <Inline DEF='TSSRStand' url=' "../../CommunicationsAndSensors/TSSR/TSSRTripod.x3d" "https://savage.nps.edu/Savage/CommunicationsAndSensors/TSSR/TSSRTripod.x3d" "../../CommunicationsAndSensors/TSSR/TSSRTripod.wrl" "https://savage.nps.edu/Savage/CommunicationsAndSensors/TSSR/TSSRTripod.wrl" '/> |
68 | </Transform> |
69 | </Transform> |
70 | <WorldInfo info='"null node for no rendering when distant"'/> |
71 | </LOD> |
72 | <LOD range='40000'> |
73 | <!-- TSSR 2 Two Transforms. One in the XZ plane, the second in the XY plane. Inlines for the TSSR body, stand, and the dome pattern. --> |
74 |
<!-- ROUTE information for TSSR2_TRANSFORM node:
[from CalculateAngleScript.TSSR2_XZangle to rotation
]
-->
<Transform DEF='TSSR2_TRANSFORM'> |
75 | <IS> |
76 | <connect nodeField='translation' protoField='TSSR2Location'/> |
77 | </IS> |
78 |
<!-- ROUTE information for TSSR2_XY_TRANSFORM node:
[from CalculateAngleScript.TSSR2_XYangle to rotation
]
-->
<Transform DEF='TSSR2_XY_TRANSFORM'> |
79 | <Inline USE='TSSRBody'/> |
80 | <Transform DEF='TSSR2Cone' translation='1 0 0'> |
81 |
<!-- ROUTE information for TSSR2_BEAMCYLINDER node:
[from CalculateAngleScript.beamLength to range
]
[from CalculateAngleScript.LinkEstablished to contact
]
-->
<ProtoInstance name='BeamCylinder' DEF='TSSR2_BEAMCYLINDER'> |
82 | <fieldValue name='defaultRange' value='10'/> |
83 | <fieldValue name='beamHeight' value='1'/> |
84 | <fieldValue name='beamWidth' value='1'/> |
85 | <fieldValue name='transparency' value='0.2'/> |
86 | <fieldValue name='wireframe' value='true'/> |
87 | <fieldValue name='solid' value='true'/> |
88 | <fieldValue name='contactColor' value='.3 .5 .5'/> |
89 | <fieldValue name='noContactColor' value='.8 .1 .1'/> |
90 | </ProtoInstance> |
91 | <LOD range='100'> |
92 | <Transform> |
93 | <Viewpoint description='TSSR2 side view' orientation='0 1 0 3.14' position='0 0 -10'/> |
94 | </Transform> |
95 | <WorldInfo info='"null node for no rendering when distant"'/> |
96 | </LOD> |
97 | </Transform> |
98 | </Transform> |
99 | <Transform> |
100 | <Inline USE='TSSRStand'/> |
101 | </Transform> |
102 | </Transform> |
103 | <WorldInfo info='"null node for no rendering when distant"'/> |
104 | </LOD> |
105 | <Script DEF='TransmitScript'> |
106 | <field name='transState' type='SFInt32' accessType='inputOnly'/> |
107 | <field name='size' type='SFVec3f' accessType='outputOnly'/> |
<![CDATA[
ecmascript: function initialize () { size = new SFVec3f(100, 100, 100) ; Browser.println ('TransmitScript initialize() complete') ; } // function name matches eventIn variable name ('hour') // hourValue captures the new value of the ROUTE hour event // minutes is just the current field value function transState (newValue, timestamp) { transmitState = newValue ; if (transmitState == 3) { size = new SFVec3f(10, 10, 10) ; } else { size = new SFVec3f(100, 100, 100) ; } Browser.println ('size = ' + size) ; }
]]>
|
|
109 | </Script> |
110 | <Script DEF='TransmitScript2'> |
111 | <field name='transState' type='SFInt32' accessType='inputOnly'/> |
112 | <field name='size' type='SFVec3f' accessType='outputOnly'/> |
<![CDATA[
ecmascript: function initialize () { size = new SFVec3f(100, 100, 100) ; Browser.println ('TransmitScript initialize() complete') ; } // function name matches eventIn variable name ('hour') // hourValue captures the new value of the ROUTE hour event // minutes is just the current field value function transState (newValue, timestamp) { transmitState = newValue ; if (transmitState == 3) { size = new SFVec3f(10, 10, 10) ; } else { size = new SFVec3f(100, 100, 100) ; } Browser.println ('size = ' + size) ; }
]]>
|
|
114 | </Script> |
115 | <!-- This script is used to calculate the corresponding rotation angles so the TSSRs will be pointed at each other --> |
116 |
<!-- ROUTE information for CalculateAngleScript node:
[from TSSR1_XZangle to TSSR1_TRANSFORM.rotation
]
[from TSSR2_XZangle to TSSR2_TRANSFORM.rotation
]
[from beamLength to TSSR1_BEAMCYLINDER.range
]
[from beamLength to TSSR2_BEAMCYLINDER.range
]
[from TSSR1_XYangle to TSSR1_XY_TRANSFORM.rotation
]
[from TSSR2_XYangle to TSSR2_XY_TRANSFORM.rotation
]
[from LinkEstablished to TSSR1_BEAMCYLINDER.contact
]
[from LinkEstablished to TSSR2_BEAMCYLINDER.contact
]
[from ViewpointLocation to TSSRPairViewpoint.position
]
[from ViewpointAngle to TSSRPairViewpoint.orientation
]
-->
<Script DEF='CalculateAngleScript'> |
117 | <field name='TSSR1Location' type='SFVec3f' accessType='initializeOnly'/> |
118 | <field name='TSSR2Location' type='SFVec3f' accessType='initializeOnly'/> |
119 | <field name='TSSR1_XZangle' type='SFRotation' accessType='outputOnly'/> |
120 | <field name='TSSR2_XZangle' type='SFRotation' accessType='outputOnly'/> |
121 | <field name='beamScale' type='SFVec3f' accessType='outputOnly'/> |
122 | <field name='beamLength' type='SFFloat' accessType='outputOnly'/> |
123 | <field name='TSSR1_XYangle' type='SFRotation' accessType='outputOnly'/> |
124 | <field name='TSSR2_XYangle' type='SFRotation' accessType='outputOnly'/> |
125 | <field name='LinkEstablished' type='SFBool' accessType='outputOnly'/> |
126 | <field name='ViewpointLocation' type='SFVec3f' accessType='outputOnly'/> |
127 | <field name='ViewpointAngle' type='SFRotation' accessType='outputOnly'/> |
128 | <IS> |
129 | <connect nodeField='TSSR1Location' protoField='TSSR1Location'/> |
130 | <connect nodeField='TSSR2Location' protoField='TSSR2Location'/> |
131 | </IS> |
<![CDATA[
ecmascript: function initialize () { Browser.println ('TSSR1 =' + TSSR1Location) ; Browser.println ('TSSR2 =' + TSSR2Location) ; Browser.println ('TransmitScript initialize() complete') ; active = true ; TSSR1_XZangle = new SFRotation(0, 1, 0, 0) ; TSSR2_XZangle = new SFRotation(0, 1, 0, 0) ; TSSR1_XYangle = new SFRotation(0, 0, 1, 0) ; TSSR2_XYangle = new SFRotation(0, 0, 1, 0) ; beamScale = new SFVec3f ( ) ; ViewpointLocation = new SFVec3f ( ) ; ViewpointAngle = new SFRotation(0, 1, 0, 0) ; LinkEstablished = true; compute(active) ; } function compute ( ) { computeDistance( ) ; computeXZangle( ); ViewpointLocation[0] = TSSR1Location[0] ; ViewpointLocation[1] = TSSR1Location[1] + 4; ViewpointLocation[2] = TSSR1Location[2] ; Browser.println ('ViewpointLocation =' + ViewpointLocation) ; ViewpointAngle[3] = TSSR1_XZangle[3] - Math.PI/2; Browser.println ('ViewpointAngle =' + ViewpointAngle) ; computeXYangle( ) ; } function computeDistance( ) { Browser.println ('TSSR1 =' + TSSR1Location) ; Browser.println ('TSSR2 =' + TSSR2Location) ; deltaX = (TSSR2Location[0] - TSSR1Location[0]) ; deltaY = (TSSR2Location[1] - TSSR1Location[1]) ; deltaZ = (TSSR2Location[2] - TSSR1Location[2]) ; distanceSquared = deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ ; Browser.println ('Distance Squared =' + distanceSquared) ; distance = Math.sqrt(distanceSquared) ; Browser.println ('Distance =' + distance) ; beamScale[0] = distance/10; beamScale[1] = 5; beamScale[2] = 5; Browser.println ('BeamScale =' + beamScale) ; beamLength = distance - 2 ; if (distance > 5000/.6) { LinkEstablished = false; beamLength = 5000; } } function computeXZangle( ) { if (deltaZ == 0) { deltaZ = .00000001 ; } angle = Math.atan(deltaX/deltaZ) ; if (deltaZ < 0) { TSSR1_XZangle[3] = angle + Math.PI/2; } else { TSSR1_XZangle[3] = angle - Math.PI/2; } TSSR2_XZangle[3] = TSSR1_XZangle[3] + Math.PI; Browser.println ('Angle =' + TSSR1_XZangle[3]) ; Browser.println ('Angle2 =' + TSSR2_XZangle[3]) ; } function computeXYangle( ) { angle = Math.asin(deltaY/distance) ; TSSR1_XYangle[3] = angle ; TSSR2_XYangle[3] = - TSSR1_XYangle[3]; Browser.println ('AngleXY =' + TSSR1_XYangle[3]) ; Browser.println ('Angle2XY =' + TSSR2_XYangle[3]) ; }
]]>
|
|
133 | </Script> |
134 | </Group> |
135 | < ROUTE fromNode='CalculateAngleScript' fromField='TSSR1_XZangle' toNode='TSSR1_TRANSFORM' toField='rotation'/> |
136 | < ROUTE fromNode='CalculateAngleScript' fromField='TSSR2_XZangle' toNode='TSSR2_TRANSFORM' toField='rotation'/> |
137 | < ROUTE fromNode='CalculateAngleScript' fromField='beamLength' toNode='TSSR1_BEAMCYLINDER' toField='range'/> |
138 | < ROUTE fromNode='CalculateAngleScript' fromField='beamLength' toNode='TSSR2_BEAMCYLINDER' toField='range'/> |
139 | < ROUTE fromNode='CalculateAngleScript' fromField='TSSR1_XYangle' toNode='TSSR1_XY_TRANSFORM' toField='rotation'/> |
140 | < ROUTE fromNode='CalculateAngleScript' fromField='TSSR2_XYangle' toNode='TSSR2_XY_TRANSFORM' toField='rotation'/> |
141 | < ROUTE fromNode='CalculateAngleScript' fromField='LinkEstablished' toNode='TSSR1_BEAMCYLINDER' toField='contact'/> |
142 | < ROUTE fromNode='CalculateAngleScript' fromField='LinkEstablished' toNode='TSSR2_BEAMCYLINDER' toField='contact'/> |
143 | < ROUTE fromNode='CalculateAngleScript' fromField='ViewpointLocation' toNode='TSSRPairViewpoint' toField='position'/> |
144 | < ROUTE fromNode='CalculateAngleScript' fromField='ViewpointAngle' toNode='TSSRPairViewpoint' toField='orientation'/> |
145 | </ProtoBody> |
146 | </ProtoDeclare> |
147 | <!-- ==================== --> |
148 | <WorldInfo info='"Author: Mike Hunsberger" "Revised: 30 April 2001" "Purpose: Pair of TSSRs" "Browser: CosmoPlayer"' title='AntennaWorld'/> |
149 | <ProtoInstance name='TSSRPair'> |
150 | <fieldValue name='TSSR1Location' value='0 0 0'/> |
151 | <fieldValue name='TSSR2Location' value='50 0 50'/> |
152 | </ProtoInstance> |
153 | <Background groundAngle='1.57079' groundColor='1 0.8 0.6 0.6 0.4 0.2' skyAngle='0.2' skyColor='1 1 1 0.2 0.2 1'/> |
154 | </Scene> |
155 | </X3D> |
Event Graph ROUTE Table entries with 10 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.
This node has 10 outgoing ROUTEs, which is greater than $maxROUTEdepth=8 | |||||||
CalculateAngleScript
Script TSSR1_XZangle SFRotation |
TSSR1_TRANSFORM
Transform rotation SFRotation |
||||||
CalculateAngleScript
Script TSSR2_XZangle SFRotation |
TSSR2_TRANSFORM
Transform rotation SFRotation |
||||||
CalculateAngleScript
Script beamLength SFFloat |
TSSR1_BEAMCYLINDER
ProtoInstance range SFFloat |
||||||
CalculateAngleScript
Script beamLength SFFloat |
TSSR2_BEAMCYLINDER
ProtoInstance range SFFloat |
||||||
CalculateAngleScript
Script TSSR1_XYangle SFRotation |
TSSR1_XY_TRANSFORM
Transform rotation SFRotation |
||||||
CalculateAngleScript
Script TSSR2_XYangle SFRotation |
TSSR2_XY_TRANSFORM
Transform rotation SFRotation |
||||||
CalculateAngleScript
Script LinkEstablished SFBool |
TSSR1_BEAMCYLINDER
ProtoInstance contact SFBool |
||||||
CalculateAngleScript
Script LinkEstablished SFBool |
TSSR2_BEAMCYLINDER
ProtoInstance contact SFBool |
||||||
TransmitScript
Script |
No ROUTE connection found for output events from this node. This Script has no direct access to other nodes. |
TransmitScript2
Script |
No ROUTE connection found for output events from this node. This Script has no direct access to other nodes. |
line 149
ProtoInstance TSSRPair |
No ROUTE connection found for output events from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
TSSR1_BEAMCYLINDER
ProtoInstance BeamCylinder |
No ROUTE connection found for output events from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
TSSR2_BEAMCYLINDER
ProtoInstance BeamCylinder |
No ROUTE connection found for output events from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
<!--
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)
<ProtoInstance name='ProtoName'>
<field
name='fieldName'/> </ProtoInstance>
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->