X3D Model Documentation: TRC170PairPrototype.x3d go to online X3D Example Archives model page

  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='https://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  4       <head>
  5            <meta name='title' content=' TRC170PairPrototype.x3d '/>
  6            <meta name='description' content='A Pair of TRC-170s. A TRC-170 is a long-range SHF communication system. It operates in 3 modes. 1)Direct point-to-point link (< 30 miles). 2) Tropospheric shot (up to 100 or 150 miles, depending on system version). 3) Defraction shot over an a terrain feature or object in the path ( < 50 miles).'/>
  7            <meta name='creator' content='Mike Hunsberger'/>
  8            <meta name='created' content='8 May 2001'/>
  9            <meta name='modified' content='12 October 2023'/>
 10            <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TRC170/TRC170PairPrototype.x3d '/>
 11            <meta name='generator' content='X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 12            <meta name='license' content='../../license.html'/>
 13       </head>
<!--

Event Graph ROUTE Table shows event connections.

--> <!-- to top DEF nodes index: BeamSwitch, BeamSwitch2, CalculateAngleScript, HighAboveXZTranslation, TransmitScript, TransmitScript2, TRC1_BEAMCONE, TRC1_BEAMCYLINDER, TRC1_TRANSFORM, TRC1_XY_TRANSFORM, TRC1Cone, TRC2_BEAMCONE, TRC2_BEAMCYLINDER, TRC2_TRANSFORM, TRC2_XY_TRANSFORM, TRC2Cone, TRCBody, TRCStand

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2, HighAbove, TRC1Viewpoint, TRC2Viewpoint

Index for ExternProtoDeclare definitions: BeamCone, BeamCylinder

Index for ProtoDeclare definition: TRC170Pair

-->
 14       <Scene>
 15  go to online X3D Example Archives model page           <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://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamCylinderPrototype.x3d#BeamCylinder" "../../CommunicationsAndSensors/Beam/BeamCylinderPrototype.wrl#BeamCylinder" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamCylinderPrototype.wrl#BeamCylinder"'>
 16                 <field name='contact' type='SFBool' accessType='inputOnly' appinfo='(communications) is transmitted signal in contact with receiver or (sensor) is a target return detected?'/>
 17                 <field name='range' type='SFFloat' accessType='inputOnly' appinfo='distance in meters along x axis'/>
 18                 <field name='defaultRange' type='SFFloat' accessType='initializeOnly' appinfo='distance in meters used until eventIn range sent'/>
 19                 <field name='wireframe' type='SFBool' accessType='initializeOnly' appinfo='whether wireframe beam is drawn'/>
 20                 <field name='solid' type='SFBool' accessType='initializeOnly' appinfo='whether solid beam is drawn'/>
 21                 <field name='beamHeight' type='SFFloat' accessType='initializeOnly' appinfo='meters across vertical y axis'/>
 22                 <field name='beamWidth' type='SFFloat' accessType='initializeOnly' appinfo='meters across horizontal z axis'/>
 23                 <field name='contactColor' type='SFColor' accessType='initializeOnly' appinfo='rendering color when contact=true'/>
 24                 <field name='noContactColor' type='SFColor' accessType='initializeOnly' appinfo='rendering color when contact=false'/>
 25                 <field name='transparency' type='SFFloat' accessType='inputOutput' appinfo='1 = fully transparent wireframe only'/>
 26                 <field name='name' type='SFString' accessType='initializeOnly' appinfo='Assigning a name to a BeamCylinder aids tracing'/>
 27            </ExternProtoDeclare>
 28  go to online X3D Example Archives model page           <ExternProtoDeclare name='BeamCone' appinfo='Produce wireframe or transparent beam cones. 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/BeamConePrototype.x3d#BeamCone" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamConePrototype.x3d#BeamCone" "../../CommunicationsAndSensors/Beam/BeamConePrototype.wrl#BeamCone" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamConePrototype.wrl#BeamCone"'>
 29                 <field name='contact' type='SFBool' accessType='inputOnly' appinfo='(communications) is transmitted signal in contact with receiver or (sensor) is a target return detected?'/>
 30                 <field name='range' type='SFFloat' accessType='inputOnly' appinfo='distance in meters along x axis'/>
 31                 <field name='defaultRange' type='SFFloat' accessType='initializeOnly' appinfo='distance in meters used until eventIn range sent'/>
 32                 <field name='wireframe' type='SFBool' accessType='initializeOnly' appinfo='whether wireframe beam is drawn'/>
 33                 <field name='solid' type='SFBool' accessType='initializeOnly' appinfo='whether solid beam is drawn'/>
 34                 <field name='beamHeightDegrees' type='SFFloat' accessType='initializeOnly' appinfo='degrees across vertical y axis'/>
 35                 <field name='beamWidthDegrees' type='SFFloat' accessType='initializeOnly' appinfo='degrees across horizontal z axis'/>
 36                 <field name='contactColor' type='SFColor' accessType='initializeOnly' appinfo='rendering color when contact=true'/>
 37                 <field name='noContactColor' type='SFColor' accessType='initializeOnly' appinfo='rendering color when contact=false'/>
 38                 <field name='transparency' type='SFFloat' accessType='inputOutput' appinfo='1 = fully transparent wireframe only'/>
 39                 <field name='name' type='SFString' accessType='initializeOnly' appinfo='BeamCone name aids in node identification and tracing'/>
 40                 <field name='traceEnabled' type='SFBool' accessType='initializeOnly' appinfo='flag to turn on Script tracing'/>
 41            </ExternProtoDeclare>
 42            <!-- ExternProtoDeclare definitions must be included verbatim -->
 43            <!-- PROTO consists of two TRC170 for long range (up to 100 mile) point-to-point communication. TRC170s can be used in 3 different settings. The first is a direct link of up to 30 miles. The second is a defraction setting over an obstruction in the path. The third is a tropospheric scatter shot of up to 100 miles in which the signal is bounced off the troposphere. This PROTO allows specification for the initial placement of each TSSR. It automatically calculates the correct angle to complete the link. -->
 44            <ProtoDeclare name='TRC170Pair'>
 45                 <ProtoInterface>
 46                      <field name='TRC1Location' type='SFVec3f' value='1 1 1' accessType='initializeOnly'/>
 47                      <field name='TRC2Location' type='SFVec3f' value='0 0 0' accessType='initializeOnly'/>
 48                      <field name='OperatingMode' type='SFString' value='DIRECT' accessType='initializeOnly'/>
 49                 </ProtoInterface>
 50                 <ProtoBody>
 51                      <Group>
 52 
                         <!-- ROUTE information for HighAboveXZTranslation node:  [from CalculateAngleScript.HighAboveViewpoint to translation ] [from CalculateAngleScript.HighAboveTranslationAngle to rotation ] -->
                         <Transform DEF='HighAboveXZTranslation'>
 53                                <Viewpoint DEF='HighAbove' description='High Above TRC170' orientation='1 0 0 -1.4' position='0 0 0'/>
 54                           </Transform>
 55 
                         <!-- ROUTE information for TRC1Viewpoint node:  [from CalculateAngleScript.TRC1_Viewpoint to position ] [from CalculateAngleScript.TRC1_ViewpointAngle to orientation ] -->
                         <Viewpoint DEF='TRC1Viewpoint' description='TRC170 #1'/>
 56 
                         <!-- ROUTE information for TRC2Viewpoint node:  [from CalculateAngleScript.TRC2_Viewpoint to position ] [from CalculateAngleScript.TRC2_ViewpointAngle to orientation ] -->
                         <Viewpoint DEF='TRC2Viewpoint' description='TRC170 #2'/>
 57                           <LOD range='200000'>
 58                                <!-- TRC 1 Two Transforms. One in the XZ plane, the second in the XY plane. Inlines for the TRC body, stand, and the dome pattern. -->
 59 
                              <!-- ROUTE information for TRC1_TRANSFORM node:  [from CalculateAngleScript.TRC1_XZangle to rotation ] -->
                              <Transform DEF='TRC1_TRANSFORM' translation='-2 0 0'>
 60                                     <IS>
 61                                          <connect nodeField='translation' protoField='TRC1Location'/>
 62                                     </IS>
 63 
                                   <!-- ROUTE information for TRC1_XY_TRANSFORM node:  [from CalculateAngleScript.TRC1_XYangle to rotation ] -->
                                   <Transform DEF='TRC1_XY_TRANSFORM' translation='1 5 0'>
 64 
                                        <!-- Inline TRCBody is a DEF node that has 1 USE node: USE_1 -->
go to online X3D Example Archives model page                                         <Inline DEF='TRCBody'   url=' "TRC170Dish.x3d" "../../CommunicationsAndSensors/TRC170/TRC170Dish.x3d" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TRC170/TRC170Dish.x3d" "TRC170Dish.wrl" "../../CommunicationsAndSensors/TRC170/TRC170Dish.wrl" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TRC170/TRC170Dish.wrl"'/>
 65                                          <Transform DEF='TRC1Cone' translation='2 0 0'>
 66 
                                             <!-- ROUTE information for BeamSwitch node:  [from CalculateAngleScript.WhichBeam to whichChoice ] -->
                                             <Switch DEF='BeamSwitch' whichChoice='0'>
 67                                                    <Group>
 68 
                                                       <!-- ROUTE information for TRC1_BEAMCYLINDER node:  [from CalculateAngleScript.TRC1_beamLength to range ] [from CalculateAngleScript.LinkEstablished to contact ] -->
                                                       <ProtoInstance name='BeamCylinder' DEF='TRC1_BEAMCYLINDER'>
 69                                                              <fieldValue name='defaultRange' value='10'/>
 70                                                              <fieldValue name='beamHeight' value='1.5'/>
 71                                                              <fieldValue name='beamWidth' value='1.5'/>
 72                                                              <fieldValue name='transparency' value='0.2'/>
 73                                                              <fieldValue name='wireframe' value='true'/>
 74                                                              <fieldValue name='solid' value='true'/>
 75                                                              <fieldValue name='contactColor' value='.3 .5 .5'/>
 76                                                              <fieldValue name='noContactColor' value='.8 .1 .1'/>
 77                                                         </ProtoInstance>
 78                                                    </Group>
 79                                                    <Group>
 80 
                                                       <!-- ROUTE information for TRC1_BEAMCONE node:  [from CalculateAngleScript.TRC1_beamLength to range ] [from CalculateAngleScript.LinkEstablished to contact ] -->
                                                       <ProtoInstance name='BeamCone' DEF='TRC1_BEAMCONE'>
 81                                                              <fieldValue name='defaultRange' value='10'/>
 82                                                              <fieldValue name='beamHeightDegrees' value='2'/>
 83                                                              <fieldValue name='beamWidthDegrees' value='2'/>
 84                                                              <fieldValue name='transparency' value='0.2'/>
 85                                                              <fieldValue name='wireframe' value='true'/>
 86                                                              <fieldValue name='solid' value='true'/>
 87                                                              <fieldValue name='noContactColor' value='.8 .1 .1'/>
 88                                                              <fieldValue name='contactColor' value='.3 .5 .5'/>
 89                                                         </ProtoInstance>
 90                                                    </Group>
 91                                               </Switch>
 92                                          </Transform>
 93                                     </Transform>
 94                                     <Transform>
 95 
                                        <!-- Inline TRCStand is a DEF node that has 1 USE node: USE_1 -->
go to online X3D Example Archives model page                                         <Inline DEF='TRCStand'   url=' "TRC170Tripod.x3d" "../../CommunicationsAndSensors/TRC170/TRC170Tripod.x3d" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TRC170/TRC170Tripod.x3d" "../../CommunicationsAndSensors/TRC170/TRC170Tripod.wrl" "TRC170Tripod.wrl" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TRC170/TRC170Tripod.wrl"'/>
 96                                          <LOD range='500'>
 97                                               <Viewpoint description='TRC170 Side View' position='0 5 40'/>
 98                                               <WorldInfo info='"null node for no rendering when distant"'/>
 99                                          </LOD>
100                                     </Transform>
101                                </Transform>
102                                <WorldInfo info='"null node for no rendering when distant"'/>
103                           </LOD>
104                           <LOD range='200000'>
105                                <!-- TRC 2 Two Transforms. One in the XZ plane, the second in the XY plane. Inlines for the TRC body, stand, and the dome pattern. -->
106 
                              <!-- ROUTE information for TRC2_TRANSFORM node:  [from CalculateAngleScript.TRC2_XZangle to rotation ] -->
                              <Transform DEF='TRC2_TRANSFORM' translation='-2 0 0'>
107                                     <IS>
108                                          <connect nodeField='translation' protoField='TRC2Location'/>
109                                     </IS>
110 
                                   <!-- ROUTE information for TRC2_XY_TRANSFORM node:  [from CalculateAngleScript.TRC2_XYangle to rotation ] -->
                                   <Transform DEF='TRC2_XY_TRANSFORM' translation='1 5 0'>
111                                          <Inline USE='TRCBody'/>
112                                          <Transform DEF='TRC2Cone' translation='2 0 0'>
113 
                                             <!-- ROUTE information for BeamSwitch2 node:  [from CalculateAngleScript.WhichBeam to whichChoice ] -->
                                             <Switch DEF='BeamSwitch2' whichChoice='0'>
114                                                    <Group>
115 
                                                       <!-- ROUTE information for TRC2_BEAMCYLINDER node:  [from CalculateAngleScript.TRC2_beamLength to range ] [from CalculateAngleScript.LinkEstablished to contact ] -->
                                                       <ProtoInstance name='BeamCylinder' DEF='TRC2_BEAMCYLINDER'>
116                                                              <fieldValue name='defaultRange' value='10'/>
117                                                              <fieldValue name='beamHeight' value='1.5'/>
118                                                              <fieldValue name='beamWidth' value='1.5'/>
119                                                              <fieldValue name='transparency' value='0.2'/>
120                                                              <fieldValue name='wireframe' value='true'/>
121                                                              <fieldValue name='solid' value='true'/>
122                                                              <fieldValue name='contactColor' value='.3 .5 .5'/>
123                                                              <fieldValue name='noContactColor' value='.8 .1 .1'/>
124                                                         </ProtoInstance>
125                                                    </Group>
126                                                    <Group>
127 
                                                       <!-- ROUTE information for TRC2_BEAMCONE node:  [from CalculateAngleScript.TRC1_beamLength to range ] [from CalculateAngleScript.LinkEstablished to contact ] -->
                                                       <ProtoInstance name='BeamCone' DEF='TRC2_BEAMCONE'>
128                                                              <fieldValue name='defaultRange' value='10'/>
129                                                              <fieldValue name='beamHeightDegrees' value='2'/>
130                                                              <fieldValue name='beamWidthDegrees' value='2'/>
131                                                              <fieldValue name='transparency' value='0.2'/>
132                                                              <fieldValue name='wireframe' value='true'/>
133                                                              <fieldValue name='solid' value='true'/>
134                                                              <fieldValue name='noContactColor' value='.8 .1 .1'/>
135                                                              <fieldValue name='contactColor' value='.3 .5 .5'/>
136                                                         </ProtoInstance>
137                                                    </Group>
138                                               </Switch>
139                                          </Transform>
140                                     </Transform>
141                                     <Transform>
142                                          <Inline USE='TRCStand'/>
143                                          <LOD range='500'>
144                                               <Transform>
145                                                    <Viewpoint description='TRC170 Side View' position='0 5 40'/>
146                                               </Transform>
147                                               <Transform/>
148                                          </LOD>
149                                     </Transform>
150                                </Transform>
151                                <WorldInfo info='"null node"'/>
152                           </LOD>
153                           <Script DEF='TransmitScript'>
154                                <field name='transState' type='SFInt32' accessType='inputOnly'/>
155                                <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);
}

          
]]>
157                           </Script>
158                           <Script DEF='TransmitScript2'>
159                                <field name='transState' type='SFInt32' accessType='inputOnly'/>
160                                <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);
}

          
]]>
162                           </Script>
163                           <!-- This script is used to calculate the corresponding rotation angles so the TSSRs will be pointed at each other -->
164 
165                                <field name='TRC1Location' type='SFVec3f' accessType='initializeOnly'/>
166                                <field name='TRC2Location' type='SFVec3f' accessType='initializeOnly'/>
167                                <field name='OperatingMode' type='SFString' accessType='initializeOnly'/>
168                                <field name='TRC1_XZangle' type='SFRotation' accessType='outputOnly'/>
169                                <field name='TRC2_XZangle' type='SFRotation' accessType='outputOnly'/>
170                                <field name='beamScale' type='SFVec3f' accessType='outputOnly'/>
171                                <field name='TRC1_beamLength' type='SFFloat' accessType='outputOnly'/>
172                                <field name='TRC2_beamLength' type='SFFloat' accessType='outputOnly'/>
173                                <field name='TRC1_XYangle' type='SFRotation' accessType='outputOnly'/>
174                                <field name='TRC2_XYangle' type='SFRotation' accessType='outputOnly'/>
175                                <field name='LinkEstablished' type='SFBool' accessType='outputOnly'/>
176                                <field name='TRC1_Viewpoint' type='SFVec3f' accessType='outputOnly'/>
177                                <field name='TRC2_Viewpoint' type='SFVec3f' accessType='outputOnly'/>
178                                <field name='TRC1_ViewpointAngle' type='SFRotation' accessType='outputOnly'/>
179                                <field name='TRC2_ViewpointAngle' type='SFRotation' accessType='outputOnly'/>
180                                <field name='HighAboveViewpoint' type='SFVec3f' accessType='outputOnly'/>
181                                <field name='HighAboveTranslationAngle' type='SFRotation' accessType='outputOnly'/>
182                                <field name='WhichBeam' type='SFInt32' accessType='outputOnly'/>
183                                <IS>
184                                     <connect nodeField='TRC1Location' protoField='TRC1Location'/>
185                                     <connect nodeField='TRC2Location' protoField='TRC2Location'/>
186                                     <connect nodeField='OperatingMode' protoField='OperatingMode'/>
187                                </IS>
  <![CDATA[
            
ecmascript:

function initialize ()
{
	Browser.println ('TRC1	=' + TRC1Location);
	Browser.println ('TRC2	=' + TRC2Location);
	Browser.println ('TransmitScript initialize() complete');
	active = true ;
	TRC1_XZangle	= new SFRotation(0, 1, 0, 0) ;
	TRC2_XZangle	= new SFRotation(0, 1, 0, 0) ;
	TRC1_XYangle	= new SFRotation(0, 0, 1, 0) ;
	TRC2_XYangle	= new SFRotation(0, 0, 1, 0) ;
	XZangle	= new SFRotation(0, 1, 0, 0) ;
	XYangle	= new SFRotation(0, 0, 1, 0) ;
	TRC1_ViewpointAngle	= new SFRotation(0, 1, 0, 0) ;
	TRC2_ViewpointAngle	= new SFRotation(0, 1, 0, 0) ;
	HighAboveViewpointAngle	= new SFRotation(1, 0, 0, 0) ;
	HighAboveTranslationAngle	= new SFRotation(0, 1, 0, 0) ;

	beamScale	   = new SFVec3f ( ) ;
	center		   = new SFVec3f ( ) ;
	TRC1_Viewpoint	   = new SFVec3f ( ) ;
	TRC2_Viewpoint	   = new SFVec3f ( ) ;
	HighAboveViewpoint = new SFVec3f ( ) ;
	LinkEstablished	= true;
	Browser.println ('OperatingMode	=' + OperatingMode);

	compute(active) ;
}

function compute ( )
{
	if (OperatingMode == 'DIRECT') {
		WhichBeam = 0 ;
		computeDistance( ) ;
		computeXZangle( );
		computeXYangle( ) ;

	}

	if (OperatingMode == 'TROPOSCATTER') {
		WhichBeam = 1 ;
		centerX 	= (TRC2Location[0] - TRC1Location[0])/2 ;
		centerZ 	= (TRC2Location[2] - TRC1Location[2])/2 ;
		XZDistance	= Math.sqrt(centerX * centerX + centerZ * centerZ);
		center[0]	= TRC1Location[0] + centerX;
		center[1]	= 15000 ;  // vertical height of troposphere
		center[2]	= TRC1Location[2] + centerZ;
                Browser.println ('TRC1	= ' + TRC1Location);
                Browser.println ('center	= ' + center);
                Browser.println ('TRC2	= ' + TRC2Location);

		computeTropoDistance(TRC1Location, center) ;
		computeTropoXZangle( );
		computeTropoXYangle( ) ;
		TRC1_beamLength 	= tropoDistance-2;
		TRC1_XZangle		= XZangle;
		TRC1_XYangle		= XYangle;

		computeTropoDistance(TRC2Location, center) ;
		computeTropoXZangle( );
		computeTropoXYangle( ) ;
		TRC2_beamLength 	= tropoDistance-2;
		TRC2_XZangle		= XZangle;
		TRC2_XYangle		= XYangle;
	}

	TRC1_Viewpoint[0]	= TRC1Location[0] + Math.sin(TRC1_XZangle[3] - 1.57)*40;
	TRC1_Viewpoint[1]	= TRC1Location[1] + 10;
	TRC1_Viewpoint[2]	= TRC1Location[2] +Math.cos(TRC1_XZangle[3] - 1.57)*40;
	Browser.println ('TRC1_Viewpoint	'+ TRC1_Viewpoint);
	TRC1_ViewpointAngle[3]	= TRC1_XZangle[3] - 1.57 ;

	TRC2_Viewpoint[0]	= TRC2Location[0] + Math.sin(TRC2_XZangle[3] - 1.57)*40 ;
	TRC2_Viewpoint[1]	= TRC2Location[1] + 10;
	TRC2_Viewpoint[2]	= TRC2Location[2] + Math.cos(TRC2_XZangle[3] - 1.57)*40;
	TRC2_ViewpointAngle[3]	= TRC2_XZangle[3] - 1.57 ;
	Browser.println ('TRC2_Viewpoint	'+ TRC2_Viewpoint);

	HighAboveViewpoint[0]	= center[0] + Math.sin(TRC1_XZangle[3])*3000 ;
	HighAboveViewpoint[1]	= center[1]  + 5000;
	HighAboveViewpoint[2]	= center[2] + Math.cos(TRC1_XZangle[3])*3000 ;
	Browser.println ('HighAboveViewpoint	'+ HighAboveViewpoint);
//	HighAboveViewpointAngle[3]	= Math.cos(TRC1_XZangle[3]) ;
	HighAboveTranslationAngle[3]	= TRC1_XZangle[3] ;
//	Browser.println ('HighAboveTranslationle		'+ HighAboveViewpointAngle);
	Browser.println ('HighAboveXZTranslationAngle	'+HighAboveTranslationAngle);



}

function computeTropoDistance(loc1, loc2 )
{
	tropoDeltaX 	= (loc2[0] - loc1[0]) ;
	tropoDeltaY 	= (loc2[1] - loc1[1]) ;
	tropoDeltaZ 	= (loc2[2] - loc1[2]) ;
	tropoDistanceSquared	= tropoDeltaX * tropoDeltaX + tropoDeltaY * tropoDeltaY + tropoDeltaZ * tropoDeltaZ ;
	Browser.println ('Distance Squared	=' + tropoDistanceSquared);
	tropoDistance 	= Math.sqrt(tropoDistanceSquared) ;
	Browser.println ('Distance	=' + tropoDistance);

	if (XZDistance > 100/.6*1000) {
		LinkEstablished = false;
		//TRC1_beamLength = 5000 ;
		//TRC2_beamLength = 5000 ;
	}
}

function computeTropoXZangle( )
{
	if (tropoDeltaZ == 0) {
		tropoDeltaZ = .00000001 ;
	}

	angle 	= Math.atan(tropoDeltaX/tropoDeltaZ) ;
	if (tropoDeltaZ < 0) {
		XZangle[3] = angle + Math.PI/2;
	}
	else {
		XZangle[3] = angle -  Math.PI/2;
	}
	Browser.println ('Angle	=' + XZangle[3]);
//	Browser.println ('Angle2	=' + TRC2_XZangle[3]);
}


function computeTropoXYangle( )
{
	Browser.println ('tropoDeltaY	=' + tropoDeltaY);
	angle 	= Math.asin(tropoDeltaY/tropoDistance) ;
	XYangle[3] = angle ;
	//XYangle[3]  = - TRC1_XYangle[3];

	Browser.println ('AngleXY	=' +XYangle[3]);
//	Browser.println ('Angle2XY	=' + TRC2_XYangle[3]);
}

function computeDistance( )
{
	Browser.println ('TRC1	=' + TRC1Location);
	Browser.println ('TRC2	=' + TRC2Location);
	deltaX 	= (TRC2Location[0] - TRC1Location[0]) ;
	deltaY 	= (TRC2Location[1] - TRC1Location[1]) ;
	deltaZ 	= (TRC2Location[2] - TRC1Location[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]	= 10;
	beamScale[2]	= 10;
	Browser.println ('BeamScale	=' + beamScale);
	TRC1_beamLength 	= distance -2;
	TRC2_beamLength 	= distance -2;
	if (distance > 5/.6*1000) {
		LinkEstablished = false;
		TRC1_beamLength = 5000/.6 ;
		TRC2_beamLength = 5000/.6 ;
	}
}

function computeXZangle( )
{
	if (deltaZ == 0) {
		deltaZ = .00000001 ;
	}

	angle 	= Math.atan(deltaX/deltaZ) ;
	if (deltaZ < 0) {
		TRC1_XZangle[3] = angle + Math.PI/2;
	}
	else {
		TRC1_XZangle[3] = angle -  Math.PI/2;
	}
	TRC2_XZangle[3]  = TRC1_XZangle[3] +  Math.PI;

	Browser.println ('Angle	=' + TRC1_XZangle[3]);
	Browser.println ('Angle2	=' + TRC2_XZangle[3]);
}



function computeXYangle( )
{
	angle 	= Math.asin(deltaY/distance) ;
	TRC1_XYangle[3] = angle ;
	TRC2_XYangle[3]  = - TRC1_XYangle[3];

	Browser.println ('AngleXY	=' + TRC1_XYangle[3]);
	Browser.println ('Angle2XY	=' + TRC2_XYangle[3]);
}

          
]]>
189                           </Script>
190                      </Group>
191                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC1_XZangle' toNode='TRC1_TRANSFORM' toField='rotation'/>
192                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC2_XZangle' toNode='TRC2_TRANSFORM' toField='rotation'/>
193                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC1_beamLength' toNode='TRC1_BEAMCYLINDER' toField='range'/>
194                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC1_beamLength' toNode='TRC1_BEAMCONE' toField='range'/>
195                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC2_beamLength' toNode='TRC2_BEAMCYLINDER' toField='range'/>
196                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC1_beamLength' toNode='TRC2_BEAMCONE' toField='range'/>
197                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC1_XYangle' toNode='TRC1_XY_TRANSFORM' toField='rotation'/>
198                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC2_XYangle' toNode='TRC2_XY_TRANSFORM' toField='rotation'/>
199                      < ROUTE  fromNode='CalculateAngleScript' fromField='LinkEstablished' toNode='TRC1_BEAMCYLINDER' toField='contact'/>
200                      < ROUTE  fromNode='CalculateAngleScript' fromField='LinkEstablished' toNode='TRC1_BEAMCONE' toField='contact'/>
201                      < ROUTE  fromNode='CalculateAngleScript' fromField='LinkEstablished' toNode='TRC2_BEAMCYLINDER' toField='contact'/>
202                      < ROUTE  fromNode='CalculateAngleScript' fromField='LinkEstablished' toNode='TRC2_BEAMCONE' toField='contact'/>
203                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC1_Viewpoint' toNode='TRC1Viewpoint' toField='position'/>
204                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC2_Viewpoint' toNode='TRC2Viewpoint' toField='position'/>
205                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC1_ViewpointAngle' toNode='TRC1Viewpoint' toField='orientation'/>
206                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC2_ViewpointAngle' toNode='TRC2Viewpoint' toField='orientation'/>
207                      < ROUTE  fromNode='CalculateAngleScript' fromField='HighAboveViewpoint' toNode='HighAboveXZTranslation' toField='translation'/>
208                      < ROUTE  fromNode='CalculateAngleScript' fromField='HighAboveTranslationAngle' toNode='HighAboveXZTranslation' toField='rotation'/>
209                      < ROUTE  fromNode='CalculateAngleScript' fromField='WhichBeam' toNode='BeamSwitch' toField='whichChoice'/>
210                      < ROUTE  fromNode='CalculateAngleScript' fromField='WhichBeam' toNode='BeamSwitch2' toField='whichChoice'/>
211                 </ProtoBody>
212            </ProtoDeclare>
213            <WorldInfo info='"Authors: Mike Hunsberger" "Revised: 30 April 2001" "Purpose: Pair of TSSRs" "Browser: CosmoPlayer"' title='AntennaWorld'/>
214            <ProtoInstance name='TRC170Pair'>
215                 <fieldValue name='TRC1Location' value='0 0 0'/>
216                 <fieldValue name='TRC2Location' value='-20000 0 -20000'/>
217                 <fieldValue name='OperatingMode' value='TROPOSCATTER'/>
218            </ProtoInstance>
219            <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'/>
220       </Scene>
221  </X3D>
<!--

Event Graph ROUTE Table shows event connections.

--> <!-- to top DEF nodes index: BeamSwitch, BeamSwitch2, CalculateAngleScript, HighAboveXZTranslation, TransmitScript, TransmitScript2, TRC1_BEAMCONE, TRC1_BEAMCYLINDER, TRC1_TRANSFORM, TRC1_XY_TRANSFORM, TRC1Cone, TRC2_BEAMCONE, TRC2_BEAMCYLINDER, TRC2_TRANSFORM, TRC2_XY_TRANSFORM, TRC2Cone, TRCBody, TRCStand

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2, HighAbove, TRC1Viewpoint, TRC2Viewpoint

Index for ExternProtoDeclare definitions: BeamCone, BeamCylinder

Index for ProtoDeclare definition: TRC170Pair

-->

X3D Tooltips element index: to top Background, connect, ExternProtoDeclare, field, fieldValue, Group, head, Inline, IS, LOD, meta, ProtoBody, ProtoDeclare, ProtoInstance, ProtoInterface, ROUTE, Scene, Script, Switch, Transform, Viewpoint, WorldInfo, X3D,
plus documentation for accessType definitions, type definitions, XML data types, and field types

🔖   Event Graph ROUTE Table entries with 13 ROUTE connections, showing X3D event-model relationships for this scene.

Each row with a ROUTE statement shows an event cascade that may occur during a single timestamp interval between frame renderings, performed as part of the X3D execution model.

TRC1_BEAMCYLINDER
ProtoInstance
BeamCylinder
No direct ROUTE connection found for events to/from this node.
This node is part of the TRC170Pair ProtoDeclare prototype declaration.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 

TRC1_BEAMCONE
ProtoInstance
BeamCone
No direct ROUTE connection found for events to/from this node.
This node is part of the TRC170Pair ProtoDeclare prototype declaration.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 

TRC2_BEAMCYLINDER
ProtoInstance
BeamCylinder
No direct ROUTE connection found for events to/from this node.
This node is part of the TRC170Pair ProtoDeclare prototype declaration.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 

TRC2_BEAMCONE
ProtoInstance
BeamCone
No direct ROUTE connection found for events to/from this node.
This node is part of the TRC170Pair ProtoDeclare prototype declaration.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 

TransmitScript
Script
No direct ROUTE connection found for events to/from this node.
This node is part of the TRC170Pair ProtoDeclare prototype declaration.
This Script has no direct access to other nodes. 

TransmitScript2
Script
No direct ROUTE connection found for events to/from this node.
This node is part of the TRC170Pair ProtoDeclare prototype declaration.
This Script has no direct access to other nodes. 

The CalculateAngleScript node has 20 outgoing ROUTEs, only $maxROUTEdepth=8 are listed here.
CalculateAngleScript
Script
TRC1_XZangle
SFRotation
→
ROUTE
event to
(1)
TRC1_TRANSFORM
Transform
rotation
SFRotation
CalculateAngleScript
Script
TRC2_XZangle
SFRotation
→
ROUTE
event to
(1)
TRC2_TRANSFORM
Transform
rotation
SFRotation
CalculateAngleScript
Script
TRC1_beamLength
SFFloat
→
ROUTE
event to
(1)
TRC1_BEAMCYLINDER
ProtoInstance
range
SFFloat
CalculateAngleScript
Script
TRC1_beamLength
SFFloat
→
ROUTE
event to
(1)
TRC1_BEAMCONE
ProtoInstance
range
SFFloat
CalculateAngleScript
Script
TRC2_beamLength
SFFloat
→
ROUTE
event to
(1)
TRC2_BEAMCYLINDER
ProtoInstance
range
SFFloat
CalculateAngleScript
Script
TRC1_beamLength
SFFloat
→
ROUTE
event to
(1)
TRC2_BEAMCONE
ProtoInstance
range
SFFloat
CalculateAngleScript
Script
TRC1_XYangle
SFRotation
→
ROUTE
event to
(1)
TRC1_XY_TRANSFORM
Transform
rotation
SFRotation
CalculateAngleScript
Script
TRC2_XYangle
SFRotation
→
ROUTE
event to
(1)
TRC2_XY_TRANSFORM
Transform
rotation
SFRotation
CalculateAngleScript
Script
LinkEstablished
SFBool
→
ROUTE
event to
(1)
TRC1_BEAMCYLINDER
ProtoInstance
contact
SFBool
CalculateAngleScript
Script
LinkEstablished
SFBool
→
ROUTE
event to
(1)
TRC1_BEAMCONE
ProtoInstance
contact
SFBool
CalculateAngleScript
Script
LinkEstablished
SFBool
→
ROUTE
event to
(1)
TRC2_BEAMCYLINDER
ProtoInstance
contact
SFBool
CalculateAngleScript
Script
LinkEstablished
SFBool
→
ROUTE
event to
(1)
TRC2_BEAMCONE
ProtoInstance
contact
SFBool
CalculateAngleScript
Script
TRC1_Viewpoint
SFVec3f
→
ROUTE
event to
(1)
TRC1Viewpoint
Viewpoint
position
SFVec3f
CalculateAngleScript
Script
TRC2_Viewpoint
SFVec3f
→
ROUTE
event to
(1)
TRC2Viewpoint
Viewpoint
position
SFVec3f
CalculateAngleScript
Script
TRC1_ViewpointAngle
SFRotation
→
ROUTE
event to
(1)
TRC1Viewpoint
Viewpoint
orientation
SFRotation
CalculateAngleScript
Script
TRC2_ViewpointAngle
SFRotation
→
ROUTE
event to
(1)
TRC2Viewpoint
Viewpoint
orientation
SFRotation
CalculateAngleScript
Script
HighAboveViewpoint
SFVec3f
→
ROUTE
event to
(1)
HighAboveXZTranslation
Transform
translation
SFVec3f
CalculateAngleScript
Script
HighAboveTranslationAngle
SFRotation
→
ROUTE
event to
(1)
HighAboveXZTranslation
Transform
rotation
SFRotation
CalculateAngleScript
Script
WhichBeam
SFInt32
→
ROUTE
event to
(1)
BeamSwitch
Switch
whichChoice
SFInt32
CalculateAngleScript
Script
WhichBeam
SFInt32
→
ROUTE
event to
(1)
BeamSwitch2
Switch
whichChoice
SFInt32

line 214
ProtoInstance
TRC170Pair
No direct ROUTE connection found for events to/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. 

Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets.
Have fun with X3D! 😀

-->
go to online X3D Example Archives model page <!-- Online at
https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TRC170/TRC170PairPrototypeIndex.html -->
<!-- SourceForge version control Version control at    
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TRC170/TRC170PairPrototype.x3d -->

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

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