X3D Model Documentation: TSSRPairPrototypeWithDIS.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            <component level='1name='DIS'/>
  6            <meta name='titlecontent=' TSSRPairPrototypeWithDIS.x3d '/>
  7            <meta name='descriptioncontent='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.'/>
  8            <meta name='creatorcontent='Mike Hunsberger'/>
  9            <meta name='createdcontent='1 May 2001'/>
 10            <meta name='modifiedcontent='20 October 2019'/>
 11            <meta name=' warning content=' upgrade ViewpointGroup '/>
 12            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TSSR/TSSRPairPrototypeWithDIS.x3d '/>
 13            <meta name='generatorcontent='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 14            <meta name='licensecontent='../../license.html'/>
 15       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: CalculateAngleScript, TextAppearance, TransmitScript, TransmitScript2, TSSR1_BEAMCYLINDER, TSSR1_RECEIVER, TSSR1_TRANSFORM, TSSR1_TRANSMITTER, TSSR1_XY_TRANSFORM, TSSR1Cone, TSSR2_BEAMCYLINDER, TSSR2_RECEIVER, TSSR2_TRANSFORM, TSSR2_TRANSMITTER, TSSR2_XY_TRANSFORM, TSSR2Cone, TSSRBody, TSSRPairViewpoint, TSSRStand

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2, TSSRPairViewpoint

Index for ExternProtoDeclare definitions: BeamCylinder, ViewpointGroup

Index for ProtoDeclare definition: TSSRPairDIS
-->
 16       <Scene>
 17            <!-- ExternProtoDeclare definitions must be included verbatim -->
 18            <ExternProtoDeclare name='BeamCylinderappinfo='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" '>
 19                 <field name='nametype='SFStringaccessType='initializeOnly'
                appinfo='Assigning a name to a BeamCylinder aids tracing'/>
 20                 <!-- eventIn, eventOut and field semantics must be retained due to exposedField not being allowed in VRML 97 scripts (unfortunately) -->
 21                 <field name='contacttype='SFBoolaccessType='inputOnly'
                appinfo='(communications) is transmitted signal in contact with receiver or (sensor) is a target return detected?'/>
 22                 <field name='rangetype='SFFloataccessType='inputOnly'
                appinfo='distance in meters along x axis'/>
 23                 <field name='defaultRangetype='SFFloataccessType='initializeOnly'
                appinfo='distance in meters used until eventIn range sent'/>
 24                 <field name='wireframetype='SFBoolaccessType='initializeOnly'
                appinfo='whether wireframe beam is drawn'/>
 25                 <field name='solidtype='SFBoolaccessType='initializeOnly'
                appinfo='whether solid beam is drawn'/>
 26                 <field name='beamHeighttype='SFFloataccessType='initializeOnly'
                appinfo='meters across vertical y axis'/>
 27                 <field name='beamWidthtype='SFFloataccessType='initializeOnly'
                appinfo='meters across horizontal z axis'/>
 28                 <field name='contactColortype='SFColoraccessType='initializeOnly'
                appinfo='rendering color when contact=true'/>
 29                 <field name='noContactColortype='SFColoraccessType='initializeOnly'
                appinfo='rendering color when contact=false'/>
 30                 <field name='transparencytype='SFFloataccessType='inputOutput'
                appinfo='1 = fully transparent wireframe only'/>
 31            </ExternProtoDeclare>
 32            <ExternProtoDeclare name='ViewpointGroupappinfo='warning: developmental prototype for X3D v3.2 node do not override native support!'   url=' "../../../Basic/development/ViewpointGroupPrototype.x3d#ViewpointGroup" "https://www.web3d.org/x3d/content/examples/Basic/development/ViewpointGroupPrototype.x3d#ViewpointGroup" "../../../Basic/development/ViewpointGroupPrototype.wrl#ViewpointGroup" "https://www.web3d.org/x3d/content/examples/Basic/development/ViewpointGroupPrototype.wrl#ViewpointGroup" '>
 33                 <field name='childrentype='MFNodeaccessType='inputOutput'
                appinfo='[Viewpoint | ViewpointGroup] only'/>
 34                 <field name='descriptiontype='SFStringaccessType='inputOutput'
                appinfo='Text description or navigation hint to be displayed for this ViewpointGroup.'/>
 35                 <field name='displayedtype='SFBoolaccessType='inputOutput'
                appinfo='Whether this ViewpointGroup description is displayed in current viewpoint list.'/>
 36                 <field name='centertype='SFVec3faccessType='inputOutput'
                appinfo='Position offset from origin of local coordinate system.'/>
 37                 <field name='radiustype='SFFloataccessType='initializeOnly'
                appinfo='[0..infinity) Radius in meters of Proximity box within which the ViewpointGroup is usable and displayed on the viewpoint list.'/>
 38                 <field name='set_radiustype='SFFloataccessType='inputOnly'
                appinfo='[0..infinity) Radius in meters of Proximity box within which the ViewpointGroup is usable and displayed on the viewpoint list.'/>
 39                 <field name='retainUserOffsetstype='SFBoolaccessType='inputOutput'
                appinfo='Whether viewpoint needs to retain (true) or rezero (false) any prior user navigation offsets from defined viewpoint position orientation.'/>
 40            </ExternProtoDeclare>
 41            <!-- 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. -->
 42            <ProtoDeclare name='TSSRPairDIS'>
 43                 <ProtoInterface>
 44                      <field name='TSSR1Locationtype='SFVec3fvalue='1 1 1accessType='initializeOnly'/>
 45                      <field name='TSSR2Locationtype='SFVec3fvalue='0 0 0accessType='initializeOnly'/>
 46                 </ProtoInterface>
 47                 <ProtoBody>
 48                      <Group>
 49 
                         <!-- ROUTE information for TSSRPairViewpoint node:  [from CalculateAngleScript.ViewpointLocation to position ] [from CalculateAngleScript.ViewpointAngle to orientation ] -->
                         <Viewpoint DEF='TSSRPairViewpointdescription='TSSR Pair Viewpoint'/>
 50                           <LOD range='40000'>
 51                                <!-- 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. -->
 52 
                              <!-- ROUTE information for TSSR1_TRANSFORM node:  [from CalculateAngleScript.TSSR1_XZangle to rotation ] -->
                              <EspduTransform DEF='TSSR1_TRANSFORMaddress='224.2.181.145port='62040containerField='children'>
 53                                     <IS>
 54                                          <connect nodeField='translationprotoField='TSSR1Location'/>
 55                                     </IS>
 56 
                                   <!-- ROUTE information for TSSR1_XY_TRANSFORM node:  [from CalculateAngleScript.TSSR1_XYangle to rotation ] -->
                                   <Transform DEF='TSSR1_XY_TRANSFORM'>
 57 
                                        <!-- Inline TSSRBody is a DEF node that has 1 USE node: USE_1 -->
                                        <Inline DEF='TSSRBody'   url=' "../../CommunicationsAndSensors/TSSR/TSSRBody.x3d" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TSSR/TSSRBody.x3d" "../../CommunicationsAndSensors/TSSR/TSSRBody.wrl" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TSSR/TSSRBody.wrl" '/>
 58                                          <Transform translation='-5 0 0'>
 59 
                                             <!-- ROUTE information for TSSR1_RECEIVER node:  [from receiverState to CalculateAngleScript.TSSR1_receiverState ] -->
                                             <ReceiverPdu DEF='TSSR1_RECEIVERaddress='224.2.181.145entityID='1port='62040readInterval='1receivedPower='0.0containerField='children'/>
 60                                          </Transform>
 61 
                                        <!-- ROUTE information for TSSR1_TRANSMITTER node:  [from transmitState to CalculateAngleScript.TSSR1_transmitState ] -->
                                        <TransmitterPdu DEF='TSSR1_TRANSMITTERaddress='224.2.181.145antennaLocation='-5 0 0entityID='5port='62040readInterval='1relativeAntennaLocation='0 0 0transmitFrequencyBandwidth='0.0containerField='children'/>
 62                                          <Transform DEF='TSSR1Conetranslation='1 0 1'>
 63                                               <Transform translation='2 2 0'>
 64                                                    <Shape>
 65                                                         <Text string='"Near End Transmitter to Far End Receiver Link"'/>
 66 
                                                       <!-- Appearance TextAppearance is a DEF node that has 1 USE node: USE_1 -->
                                                       <Appearance DEF='TextAppearance'>
 67                                                              <Material diffuseColor='1 0.937255 0.121569'/>
 68                                                         </Appearance>
 69                                                    </Shape>
 70                                               </Transform>
 71 
                                             <!-- ROUTE information for TSSR1_BEAMCYLINDER node:  [from CalculateAngleScript.beamLengthLink1 to range ] [from CalculateAngleScript.TSSR1ToTSSR2Link to contact ] -->
                                             <ProtoInstance name='BeamCylinderDEF='TSSR1_BEAMCYLINDER'>
 72                                                    <fieldValue name='defaultRangevalue='10'/>
 73                                                    <fieldValue name='beamHeightvalue='1'/>
 74                                                    <fieldValue name='beamWidthvalue='1'/>
 75                                                    <fieldValue name='transparencyvalue='0.2'/>
 76                                                    <fieldValue name='wireframevalue='true'/>
 77                                                    <fieldValue name='solidvalue='true'/>
 78                                                    <fieldValue name='contactColorvalue='.3 .5 .5'/>
 79                                                    <fieldValue name='noContactColorvalue='.8 .1 .1'/>
 80                                               </ProtoInstance>
 81                                               <LOD range='100'>
 82                                                    <ProtoInstance name='ViewpointGroup'>
 83                                                         <fieldValue name='descriptionvalue='100m from TSSR1'/>
 84                                                         <fieldValue name='radiusvalue='100'/>
 85                                                         <fieldValue name='children'>
 86                                                              <Viewpoint description='TSSR1 side view'/>
 87                                                         </fieldValue>
 88                                                    </ProtoInstance>
 89                                                    <WorldInfo info='"null node for no rendering when distant"'/>
 90                                               </LOD>
 91                                          </Transform>
 92                                     </Transform>
 93                                     <Transform>
 94 
                                        <!-- Inline TSSRStand is a DEF node that has 1 USE node: USE_1 -->
                                        <Inline DEF='TSSRStand'   url=' "../../CommunicationsAndSensors/TSSR/TSSRTripod.x3d" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TSSR/TSSRTripod.x3d" "../../CommunicationsAndSensors/TSSR/TSSRTripod.wrl" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TSSR/TSSRTripod.wrl" '/>
 95                                     </Transform>
 96                                </EspduTransform>
 97                                <WorldInfo info='"null node for no rendering when distant"'/>
 98                           </LOD>
 99                           <LOD range='40000'>
100                                <!-- 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. -->
101 
                              <!-- ROUTE information for TSSR2_TRANSFORM node:  [from CalculateAngleScript.TSSR2_XZangle to rotation ] -->
                              <EspduTransform DEF='TSSR2_TRANSFORMaddress='224.2.181.145port='62040containerField='children'>
102                                     <IS>
103                                          <connect nodeField='translationprotoField='TSSR2Location'/>
104                                     </IS>
105 
                                   <!-- ROUTE information for TSSR2_XY_TRANSFORM node:  [from CalculateAngleScript.TSSR2_XYangle to rotation ] -->
                                   <Transform DEF='TSSR2_XY_TRANSFORM'>
106                                          <Inline USE='TSSRBody'/>
107                                          <Transform translation='-5 0 0'>
108 
                                             <!-- ROUTE information for TSSR2_RECEIVER node:  [from receiverState to CalculateAngleScript.TSSR2_receiverState ] -->
                                             <ReceiverPdu DEF='TSSR2_RECEIVERaddress='224.2.181.145entityID='2port='62040readInterval='1receivedPower='0.0containerField='children'/>
109                                          </Transform>
110 
                                        <!-- ROUTE information for TSSR2_TRANSMITTER node:  [from transmitState to CalculateAngleScript.TSSR2_transmitState ] -->
                                        <TransmitterPdu DEF='TSSR2_TRANSMITTERaddress='224.2.181.145antennaLocation='-5 0 0entityID='6port='62040readInterval='1relativeAntennaLocation='0 0 0transmitFrequencyBandwidth='0.0containerField='children'/>
111                                          <Transform DEF='TSSR2Conetranslation='1 0 1'>
112                                               <Transform translation='2 2 0'>
113                                                    <Shape>
114                                                         <Text string='"Near End Transmitter to Far End Receiver Link"'/>
115                                                         <Appearance USE='TextAppearance'/>
116                                                    </Shape>
117                                               </Transform>
118 
                                             <!-- ROUTE information for TSSR2_BEAMCYLINDER node:  [from CalculateAngleScript.beamLengthLink2 to range ] [from CalculateAngleScript.TSSR2ToTSSR1Link to contact ] -->
                                             <ProtoInstance name='BeamCylinderDEF='TSSR2_BEAMCYLINDER'>
119                                                    <fieldValue name='defaultRangevalue='10'/>
120                                                    <fieldValue name='beamHeightvalue='1'/>
121                                                    <fieldValue name='beamWidthvalue='1'/>
122                                                    <fieldValue name='transparencyvalue='0.2'/>
123                                                    <fieldValue name='wireframevalue='true'/>
124                                                    <fieldValue name='solidvalue='true'/>
125                                                    <fieldValue name='contactColorvalue='.3 .5 .5'/>
126                                                    <fieldValue name='noContactColorvalue='.8 .1 .1'/>
127                                               </ProtoInstance>
128                                               <LOD range='100'>
129                                                    <ProtoInstance name='ViewpointGroup'>
130                                                         <fieldValue name='descriptionvalue='100m from TSSR2'/>
131                                                         <fieldValue name='radiusvalue='100'/>
132                                                         <fieldValue name='children'>
133                                                              <Viewpoint description='TSSR2 side vieworientation='0 1 0 3.14position='0 0 -10'/>
134                                                         </fieldValue>
135                                                    </ProtoInstance>
136                                                    <WorldInfo info='"null node for no rendering when distant"'/>
137                                               </LOD>
138                                          </Transform>
139                                     </Transform>
140                                     <Transform>
141                                          <Inline USE='TSSRStand'/>
142                                     </Transform>
143                                </EspduTransform>
144                                <WorldInfo info='"null node for no rendering when distant"'/>
145                           </LOD>
146                           <Script DEF='TransmitScript'>
147                                <field name='transStatetype='SFInt32accessType='inputOnly'/>
148                                <field name='sizetype='SFVec3faccessType='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) ;
}

          
]]>
150                           </Script>
151                           <Script DEF='TransmitScript2'>
152                                <field name='transStatetype='SFInt32accessType='inputOnly'/>
153                                <field name='sizetype='SFVec3faccessType='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) ;
}

          
]]>
155                           </Script>
156                           <!-- This script is used to calculate the corresponding rotation angles so the TSSRs will be pointed at each other -->
157 
158                                <field name='TSSR1Locationtype='SFVec3faccessType='initializeOnly'/>
159                                <field name='TSSR2Locationtype='SFVec3faccessType='initializeOnly'/>
160                                <field name='TSSR1_XZangletype='SFRotationaccessType='outputOnly'/>
161                                <field name='TSSR2_XZangletype='SFRotationaccessType='outputOnly'/>
162                                <field name='beamScaletype='SFVec3faccessType='outputOnly'/>
163                                <field name='beamLengthLink1type='SFFloataccessType='outputOnly'/>
164                                <field name='beamLengthLink2type='SFFloataccessType='outputOnly'/>
165                                <field name='TSSR1_XYangletype='SFRotationaccessType='outputOnly'/>
166                                <field name='TSSR2_XYangletype='SFRotationaccessType='outputOnly'/>
167                                <field name='TSSR1ToTSSR2Linktype='SFBoolaccessType='outputOnly'/>
168                                <field name='TSSR2ToTSSR1Linktype='SFBoolaccessType='outputOnly'/>
169                                <field name='ViewpointLocationtype='SFVec3faccessType='outputOnly'/>
170                                <field name='ViewpointAngletype='SFRotationaccessType='outputOnly'/>
171                                <field name='TSSR1_receiverStatetype='SFInt32accessType='inputOnly'/>
172                                <field name='TSSR2_receiverStatetype='SFInt32accessType='inputOnly'/>
173                                <field name='TSSR1_transmitStatetype='SFInt32accessType='inputOnly'/>
174                                <field name='TSSR2_transmitStatetype='SFInt32accessType='inputOnly'/>
175                                <IS>
176                                     <connect nodeField='TSSR1LocationprotoField='TSSR1Location'/>
177                                     <connect nodeField='TSSR2LocationprotoField='TSSR2Location'/>
178                                </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) ;

	TSSR1_RXState	= 0 ;
	TSSR1_TXState	= 2 ;
	TSSR2_RXState	= 0 ;
	TSSR2_TXState	= 1 ;
	TSSR1ToTSSR2Link	= true;
	TSSR2ToTSSR1Link	= true;
	DistanceAcceptable	= true ;

	compute(active) ;
}

function TSSR1_receiverState(newValue, timestamp) {
	TSSR1_RXState = newValue ;
	computeLink( ) ;
}

function TSSR2_transmitState(newValue, timestamp) {
	TSSR2_TXState = newValue ;
	computeLink( ) ;
}

function TSSR2_receiverState(newValue, timestamp) {
	TSSR2_RXState = newValue ;
	computeLink( ) ;
}

function TSSR1_transmitState(newValue, timestamp) {
	TSSR1_TXState = newValue ;
	computeLink( ) ;
}

function computeLink( )
{
	if ((TSSR2_TXState ==2) && (DistanceAcceptable)) {
		beamLengthLink2 	= distance - 2 ;
		if (TSSR1_RXState == 2) {
			TSSR2ToTSSR1Link = true ;
		}
		else
		{
			TSSR2ToTSSR1Link = false ;
		}
	}
	else if ((TSSR2_TXState < 2) && (DistanceAcceptable)) {
		beamLengthLink2 	= 5 ;
		TSSR2ToTSSR1Link = false ;
	}
	if ((TSSR1_TXState ==2) && (DistanceAcceptable)) {
		beamLengthLink1 	= distance - 2 ;
		if (TSSR2_RXState == 2) {
			TSSR1ToTSSR2Link = true ;
		}
		else
		{
			TSSR1ToTSSR2Link = false ;
		}
	}
	else if ((TSSR1_TXState < 2) && (DistanceAcceptable)) {
		beamLengthLink1 	= 5 ;
		TSSR1ToTSSR2Link = false ;
	}
}


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) ;
	if (distance > 5000/.6) {
		DistanceAcceptable = false;
		beamLength = 5000;
	}
	else {
		DistanceAcceptable = true ;
	}
}

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]) ;
}

          
]]>
180                           </Script>
181                      </Group>
182                      < ROUTE  fromNode='CalculateAngleScript' fromField='TSSR1_XZangle' toNode='TSSR1_TRANSFORM' toField='rotation'/>
183                      < ROUTE  fromNode='CalculateAngleScript' fromField='TSSR2_XZangle' toNode='TSSR2_TRANSFORM' toField='rotation'/>
184                      < ROUTE  fromNode='CalculateAngleScript' fromField='beamLengthLink1' toNode='TSSR1_BEAMCYLINDER' toField='range'/>
185                      < ROUTE  fromNode='CalculateAngleScript' fromField='beamLengthLink2' toNode='TSSR2_BEAMCYLINDER' toField='range'/>
186                      < ROUTE  fromNode='CalculateAngleScript' fromField='TSSR1_XYangle' toNode='TSSR1_XY_TRANSFORM' toField='rotation'/>
187                      < ROUTE  fromNode='CalculateAngleScript' fromField='TSSR2_XYangle' toNode='TSSR2_XY_TRANSFORM' toField='rotation'/>
188                      < ROUTE  fromNode='CalculateAngleScript' fromField='TSSR1ToTSSR2Link' toNode='TSSR1_BEAMCYLINDER' toField='contact'/>
189                      < ROUTE  fromNode='CalculateAngleScript' fromField='TSSR2ToTSSR1Link' toNode='TSSR2_BEAMCYLINDER' toField='contact'/>
190                      < ROUTE  fromNode='CalculateAngleScript' fromField='ViewpointLocation' toNode='TSSRPairViewpoint' toField='position'/>
191                      < ROUTE  fromNode='CalculateAngleScript' fromField='ViewpointAngle' toNode='TSSRPairViewpoint' toField='orientation'/>
192                      < ROUTE  fromNode='TSSR2_TRANSMITTER' fromField='transmitState' toNode='CalculateAngleScript' toField='TSSR2_transmitState'/>
193                      < ROUTE  fromNode='TSSR1_TRANSMITTER' fromField='transmitState' toNode='CalculateAngleScript' toField='TSSR1_transmitState'/>
194                      < ROUTE  fromNode='TSSR1_RECEIVER' fromField='receiverState' toNode='CalculateAngleScript' toField='TSSR1_receiverState'/>
195                      < ROUTE  fromNode='TSSR2_RECEIVER' fromField='receiverState' toNode='CalculateAngleScript' toField='TSSR2_receiverState'/>
196                 </ProtoBody>
197            </ProtoDeclare>
198            <WorldInfo info='"Authors: Mike Hunsberger" "Revised: 30 April 2001" "Purpose: Pair of TSSRs" "Browser: CosmoPlayer"title='AntennaWorld'/>
199            <ProtoInstance name='TSSRPairDIS'>
200                 <fieldValue name='TSSR1Locationvalue='0 0 0'/>
201                 <fieldValue name='TSSR2Locationvalue='50 0 50'/>
202            </ProtoInstance>
203            <Background groundAngle='1.57079groundColor='1 0.8 0.6 0.6 0.4 0.2skyAngle='0.2skyColor='1 1 1 0.2 0.2 1'/>
204       </Scene>
205  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: CalculateAngleScript, TextAppearance, TransmitScript, TransmitScript2, TSSR1_BEAMCYLINDER, TSSR1_RECEIVER, TSSR1_TRANSFORM, TSSR1_TRANSMITTER, TSSR1_XY_TRANSFORM, TSSR1Cone, TSSR2_BEAMCYLINDER, TSSR2_RECEIVER, TSSR2_TRANSFORM, TSSR2_TRANSMITTER, TSSR2_XY_TRANSFORM, TSSR2Cone, TSSRBody, TSSRPairViewpoint, TSSRStand

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2, TSSRPairViewpoint

Index for ExternProtoDeclare definitions: BeamCylinder, ViewpointGroup

Index for ProtoDeclare definition: TSSRPairDIS
-->
X3D Tooltips element index: Appearance, Background, component, connect, EspduTransform, ExternProtoDeclare, field, fieldValue, Group, head, Inline, IS, LOD, Material, meta, ProtoBody, ProtoDeclare, ProtoInstance, ProtoInterface, ReceiverPdu, ROUTE, Scene, Script, Shape, Text, Transform, TransmitterPdu, Viewpoint, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

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

TSSR1_TRANSMITTER
TransmitterPdu
transmitState
SFInt32

ROUTE
event to
(1)
CalculateAngleScript
Script
TSSR1_transmitState
SFInt32

TSSR2_TRANSMITTER
TransmitterPdu
transmitState
SFInt32

ROUTE
event to
(1)
CalculateAngleScript
Script
TSSR2_transmitState
SFInt32

     
This node has 10 outgoing ROUTEs, which is greater than $maxROUTEdepth=8
CalculateAngleScript
Script
TSSR1_XZangle
SFRotation

ROUTE
event to
(1)
TSSR1_TRANSFORM
EspduTransform
rotation
SFRotation
CalculateAngleScript
Script
TSSR2_XZangle
SFRotation

ROUTE
event to
(1)
TSSR2_TRANSFORM
EspduTransform
rotation
SFRotation
CalculateAngleScript
Script
beamLengthLink1
SFFloat

ROUTE
event to
(1)
TSSR1_BEAMCYLINDER
ProtoInstance
range
SFFloat
CalculateAngleScript
Script
beamLengthLink2
SFFloat

ROUTE
event to
(1)
TSSR2_BEAMCYLINDER
ProtoInstance
range
SFFloat
CalculateAngleScript
Script
TSSR1_XYangle
SFRotation

ROUTE
event to
(1)
TSSR1_XY_TRANSFORM
Transform
rotation
SFRotation
CalculateAngleScript
Script
TSSR2_XYangle
SFRotation

ROUTE
event to
(1)
TSSR2_XY_TRANSFORM
Transform
rotation
SFRotation
CalculateAngleScript
Script
TSSR1ToTSSR2Link
SFBool

ROUTE
event to
(1)
TSSR1_BEAMCYLINDER
ProtoInstance
contact
SFBool
CalculateAngleScript
Script
TSSR2ToTSSR1Link
SFBool

ROUTE
event to
(1)
TSSR2_BEAMCYLINDER
ProtoInstance
contact
SFBool

TransmitScript
Script
No direct ROUTE connection found for events to/from this node.
This Script has no direct access to other nodes. 

TransmitScript2
Script
No direct ROUTE connection found for events to/from this node.
This Script has no direct access to other nodes. 

TSSR1_RECEIVER
ReceiverPdu
receiverState
SFInt32

ROUTE
event to
(1)
CalculateAngleScript
Script
TSSR1_receiverState
SFInt32

TSSR2_RECEIVER
ReceiverPdu
receiverState
SFInt32

ROUTE
event to
(1)
CalculateAngleScript
Script
TSSR2_receiverState
SFInt32

line 82
ProtoInstance
ViewpointGroup
No direct ROUTE connection found for events to/from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declaration with
direct access to other nodes, and thus has potential to produce run-time animation. 

line 129
ProtoInstance
ViewpointGroup
No direct ROUTE connection found for events to/from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declaration with
direct access to other nodes, and thus has potential to produce run-time animation. 

line 199
ProtoInstance
TSSRPairDIS
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. 

      TSSR1_BEAMCYLINDER
ProtoInstance
BeamCylinder
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. 

      TSSR2_BEAMCYLINDER
ProtoInstance
BeamCylinder
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! 😀

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TSSR/TSSRPairPrototypeWithDISIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TSSR/TSSRPairPrototypeWithDIS.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)
    <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. -->