X3D Model Documentation: HarpoonPrototype.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2 
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
  3  <X3D profile='Immersive' version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  4       <head>
  5            <meta name='titlecontent=' HarpoonPrototype.x3d '/>
  6            <meta name='descriptioncontent='RGM84D, Harpoon Anti-Ship Cruise Missile prototype with built-in animation.'/>
  7            <meta name='creatorcontent='James Harney'/>
  8            <meta name='createdcontent='9 August 2001'/>
  9            <meta name='modifiedcontent='5 July 2025'/>
 10            <meta name=' warning content=' needs to be realigned with X-axis nose and Y-axis up. '/>
 11            <meta name='referencecontent=' https://www.fas.org/man/dod-101/sys/smart/agm-84.htm '/>
 12            <meta name='referencecontent='https://www.fas.org/man/dod-101/sys/smart/harpn01.jpg'/>
 13            <meta name='referencecontent='harpn01.jpg'/>
 14            <meta name='referencecontent='AGM-84-Harpoon-SLAM-SmartWeapons_files'/>
 15            <meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/Savage/CruiserUnitedStates/Cruiser.x3d '/>
 16            <meta name='referencecontent=' http://www.specialoperations.com/multimedia/sounds.html '/>
 17            <meta name='referencecontent=' http://www.specialoperations.com/multimedia/sounds.html '/>
 18            <meta name='referencecontent=' See url "soundpermissions.html" for copyright info and use on missile1.au and exp03.au that are converted to missile1.wav and exp03.wav for use in this file/model '/>
 19            <meta name='accessRightscontent=' soundpermissions.html '/>
 20            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/HarpoonPrototype.x3d '/>
 21            <meta name='generatorcontent='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 22            <meta name='licensecontent='../../license.html'/>
 23       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: AFTFIN, BACKFIN, BANDS, BFIN, BOOSTER, BOOSTERFIN, BOOSTSECT, CONE, EXHAUST, EXHAUSTCLOCK, EXHINT, FIN, FINCOLOR, Flames, MIDFIN, MISSILEBODY, RGMCLOCK, RGMCOLOR, RGMSOUND, RGMSSM, TimeFilter2

Index for ProtoDeclare definition: RGM84D
-->
 24       <Scene>
 25            <WorldInfo title='HarpoonPrototype.x3d'/>
 26            <ProtoDeclare name='RGM84D'>
 27                 <ProtoInterface>
 28                      <field name='STARTLAUNCHtype='SFBoolaccessType='inputOnly'/>
 29                      <field name='THETIMEtype='SFTimeaccessType='inputOnly'/>
 30                 </ProtoInterface>
 31                 <ProtoBody>
 32                      <Transform DEF='RGMSSMrotation='0 0 1 -1.57translation='2.5 0 0'>
 33                           <Transform>
 34                                <!-- Built as well as possible to scale from pictures on FAS web site. Missile speed and distance for engagement are not what they are in real life for demonstration purposes. -->
 35                                <!-- Used with permission. See soundpermissions.html for details. -->
 36                                <Sound maxBack='50000maxFront='50000'>
 37 
                                   <!-- ROUTE information for RGMSOUND node:  [from RGMCLOCK.startTime to startTime ] [from RGMCLOCK.stopTime to set_stopTime ] -->
                                   <AudioClip DEF='RGMSOUNDdescription='Missile flight'   url=' "MISSILE1.wav" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/MISSILE1.wav" '/>
 38                                </Sound>
 39                                <Transform translation='0 -2.22 0'>
 40                                     <Group DEF='MISSILEBODY'>
 41                                          <Transform>
 42                                               <Shape>
 43 
                                                  <!-- Appearance RGMCOLOR is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
                                                  <Appearance DEF='RGMCOLOR'>
 44                                                         <Material diffuseColor='1 1 1shininess='.7specularColor='1 1 1'/>
 45                                                    </Appearance>
 46                                                    <Cylinder height='4.55radius='.3429'/>
 47                                               </Shape>
 48                                          </Transform>
 49                                     </Group>
 50                                </Transform>
 51                                <Transform scale='1.31 1.31 1.31'>
 52                                     <Group DEF='CONE'>
 53                                          <Shape>
 54                                               <Appearance USE='RGMCOLOR'/>
 55                                               <Extrusion creaseAngle='1.785crossSection='0.267 0.000 0.231 -0.134 0.134 -0.231 0.0 -0.267 -0.134 -0.231 -0.231 -0.134 -0.267 0.000 -0.231 0.134 -0.134 0.231 0.0 0.267 0.134 0.231 0.231 0.134 0.267 0.0scale='1.00 1.00 0.95 0.95 0.88 0.88 0.76 0.76 0.48 0.48spine='0.00 0.00 0.00 0.00 0.10 0.00 0.00 0.20 0.00 0.00 0.30 0.00 0.00 0.40 0.00'/>
 56                                          </Shape>
 57                                     </Group>
 58                                </Transform>
 59                                <Transform>
 60                                     <Group DEF='MIDFIN'>
 61                                          <Transform translation='.34 -3.02 0'>
 62 
                                             <!-- Shape FIN is a DEF node that has 3 USE nodes: USE_1, USE_2, USE_3 -->
                                             <Shape DEF='FIN'>
 63                                                    <IndexedFaceSet solid='falsecoordIndex='0 1 2 3 4 -1'>
 64                                                         <Coordinate point='0 0 0 0 1.1 0 .5 .75 0 .5 .25 0 0 0 0'/>
 65                                                    </IndexedFaceSet>
 66 
                                                  <!-- Appearance FINCOLOR is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
                                                  <Appearance DEF='FINCOLOR'>
 67                                                         <Material diffuseColor='.9 .9 .9'/>
 68                                                    </Appearance>
 69                                               </Shape>
 70                                          </Transform>
 71                                          <Transform rotation='0 1 0 1.57translation='0 -3.02 -.34'>
 72                                               <Shape USE='FIN'/>
 73                                          </Transform>
 74                                          <Transform rotation='0 1 0 -1.57translation='0 -3.02 .34'>
 75                                               <Shape USE='FIN'/>
 76                                          </Transform>
 77                                          <Transform rotation='0 1 0 3.14translation='-.34 -3.02 0'>
 78                                               <Shape USE='FIN'/>
 79                                          </Transform>
 80                                     </Group>
 81                                     <Group DEF='AFTFIN'>
 82                                          <Transform translation='.34 -4.4 0'>
 83 
                                             <!-- Shape BACKFIN is a DEF node that has 3 USE nodes: USE_1, USE_2, USE_3 -->
                                             <Shape DEF='BACKFIN'>
 84                                                    <Appearance USE='FINCOLOR'/>
 85                                                    <IndexedFaceSet solid='falsecoordIndex='0 1 2 3 4 -1'>
 86                                                         <Coordinate point='0 0 0 0 .5 0 .5 .35 0 .5 .15 0 0 0 0'/>
 87                                                    </IndexedFaceSet>
 88                                               </Shape>
 89                                          </Transform>
 90                                          <Transform rotation='0 1 0 1.57translation='0 -4.4 -.34'>
 91                                               <Shape USE='BACKFIN'/>
 92                                          </Transform>
 93                                          <Transform rotation='0 1 0 3.14translation='-.34 -4.4 0'>
 94                                               <Shape USE='BACKFIN'/>
 95                                          </Transform>
 96                                          <Transform rotation='0 1 0 -1.57translation='0 -4.4 .34'>
 97                                               <Shape USE='BACKFIN'/>
 98                                          </Transform>
 99                                          <Transform translation='0 -4.45 0'>
100                                               <Shape>
101                                                    <Cylinder height='.1radius='.35'/>
102                                                    <Appearance>
103                                                         <Material diffuseColor='1 0 0'/>
104                                                    </Appearance>
105                                               </Shape>
106                                          </Transform>
107                                     </Group>
108                                </Transform>
109                                <Transform DEF='BOOSTSECT'>
110                                     <Group DEF='BOOSTER'>
111                                          <Transform translation='0 -4.85 0'>
112                                               <Shape>
113                                                    <Appearance USE='RGMCOLOR'/>
114                                                    <Cylinder height='.69radius='.3429'/>
115                                               </Shape>
116                                          </Transform>
117                                          <Group DEF='BOOSTERFIN'>
118                                               <Transform translation='.34 -5.2 0'>
119 
                                                  <!-- Shape BFIN is a DEF node that has 3 USE nodes: USE_1, USE_2, USE_3 -->
                                                  <Shape DEF='BFIN'>
120                                                         <Appearance USE='FINCOLOR'/>
121                                                         <IndexedFaceSet solid='falsecoordIndex='0 1 2 3 4 -1'>
122                                                              <Coordinate point='0 0 0 0 .5 0 .5 .35 0 .5 0 0 0 0 0'/>
123                                                         </IndexedFaceSet>
124                                                    </Shape>
125                                               </Transform>
126                                               <Transform rotation='0 1 0 1.57translation='0 -5.2 -.34'>
127                                                    <Shape USE='BFIN'/>
128                                               </Transform>
129                                               <Transform rotation='0 1 0 3.14translation='-.34 -5.2 0'>
130                                                    <Shape USE='BFIN'/>
131                                               </Transform>
132                                               <Transform rotation='0 1 0 -1.57translation='0 -5.2 .34'>
133                                                    <Shape USE='BFIN'/>
134                                               </Transform>
135                                          </Group>
136                                     </Group>
137 
                                   <!-- ROUTE information for EXHAUST node:  [from EXHINT.value_changed to set_scale ] -->
                                   <Transform DEF='EXHAUSTrotation='0 1 0 3.14scale='0.5 0.5 0.5translation='0 -7.51 0'>
138                                          <!-- Exhaust flames are from the torch example in the source book. -->
139 
                                        <!-- Shape Flames is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
                                        <Shape DEF='Flames'>
140                                               <!-- No appearance, use emissive shading -->
141                                               <IndexedFaceSet coordIndex='0 1 2 -1 3 4 5 -1 6 7 8 -1'>
142                                                    <Coordinate point='0.25 0.0 0.00 0.15 1.0 0.10 0.05 0.0 0.15 0.18 0.0 0.05 0.00 1.2 0.05 -0.10 0.0 0.05 -0.00 0.0 0.15 -0.13 0.8 0.10 -0.25 -0.25 0.00'/>
143                                                    <Color color='1.0 0.0 0.0 0.9 0.5 0 1.0 0.0 0.0 0.9 0.3 0 1.0 1.0 0.0 0.9 0.3 0 0.7 0.1 0.2 0.9 0.8 0 1.0 0.0 0.0'/>
144                                               </IndexedFaceSet>
145                                               <Appearance>
146                                                    <Material transparency='.15'/>
147                                               </Appearance>
148                                          </Shape>
149                                          <Transform rotation='0 1 0 1.57scale='0.9 0.9 1'>
150                                               <Shape USE='Flames'/>
151                                          </Transform>
152                                          <Transform rotation='0 1 0 -1.57scale='0.9 0.9 1'>
153                                               <Shape USE='Flames'/>
154                                          </Transform>
155                                     </Transform>
156                                </Transform>
157                                <Transform>
158                                     <Group DEF='BANDS'>
159                                          <Transform translation='0 -1.87 0'>
160                                               <Shape>
161                                                    <Cylinder height='.1radius='.35'/>
162                                                    <Appearance>
163                                                         <Material diffuseColor='1 0 0'/>
164                                                    </Appearance>
165                                               </Shape>
166                                          </Transform>
167                                          <Transform translation='0 -1.62 0'>
168                                               <Shape>
169                                                    <Cylinder height='.1radius='.35'/>
170                                                    <Appearance>
171                                                         <Material diffuseColor='1 0 0'/>
172                                                    </Appearance>
173                                               </Shape>
174                                          </Transform>
175                                     </Group>
176                                </Transform>
177                           </Transform>
178 
                         <!-- ROUTE information for EXHINT node:  [from EXHAUSTCLOCK.fraction_changed to set_fraction ] [from value_changed to EXHAUST.set_scale ] -->
                         <PositionInterpolator DEF='EXHINTkey='0 .25 .5 .75 1keyValue='1.4 1.4 1.4 2 2 2 2.5 2.5 2.5 2 2 2 1.4 1.4 1.4'/>
179 
                         <!-- ROUTE information for EXHAUSTCLOCK node:  [from TimeFilter2.startEventTime to set_startTime ] [from fraction_changed to EXHINT.set_fraction ] -->
                         <TimeSensor DEF='EXHAUSTCLOCKloop='true'/>
180 
                         <!-- ROUTE information for RGMCLOCK node:  [from TimeFilter2.startEventTime to set_startTime ] [from startTime to RGMSOUND.startTime ] [from stopTime to RGMSOUND.set_stopTime ] -->
                         <TimeSensor DEF='RGMCLOCKcycleInterval='28'/>
181 
                         <!-- ROUTE information for TimeFilter2 node:  [from startEventTime to RGMCLOCK.set_startTime ] [from startEventTime to EXHAUSTCLOCK.set_startTime ] -->
                         <Script DEF='TimeFilter2'>
182                                <field name='setStarttype='SFBoolaccessType='inputOnly'/>
183                                <field name='InputTimetype='SFTimeaccessType='inputOnly'/>
184                                <field name='startEventTimetype='SFTimeaccessType='outputOnly'/>
185                                <IS>
186                                     <connect nodeField='setStartprotoField='STARTLAUNCH'/>
187                                     <connect nodeField='InputTimeprotoField='THETIME'/>
188                                </IS>
  <![CDATA[
            
ecmascript:


function setStart ( value, InputTime ) {

	startEventTime = InputTime ;

}

          
]]>
190                           </Script>
191                      </Transform>
192                      < ROUTE  fromNode='TimeFilter2' fromField='startEventTime' toNode='RGMCLOCK' toField='set_startTime'/>
193                      < ROUTE  fromNode='RGMCLOCK' fromField='startTime' toNode='RGMSOUND' toField='startTime'/>
194                      < ROUTE  fromNode='RGMCLOCK' fromField='stopTime' toNode='RGMSOUND' toField='set_stopTime'/>
195                      < ROUTE  fromNode='TimeFilter2' fromField='startEventTime' toNode='EXHAUSTCLOCK' toField='set_startTime'/>
196                      < ROUTE  fromNode='EXHAUSTCLOCK' fromField='fraction_changed' toNode='EXHINT' toField='set_fraction'/>
197                      < ROUTE  fromNode='EXHINT' fromField='value_changed' toNode='EXHAUST' toField='set_scale'/>
198                 </ProtoBody>
199            </ProtoDeclare>
200            <!-- ==================== -->
201            <Background skyColor='0.604 0.753 0.804'/>
202            <Anchor description='Harpoon Exampleparameter='"target=_blank"'   url=' "HarpoonExample.x3d" "../../Weapons/Missiles/HarpoonExample.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/HarpoonExample.x3d" "HarpoonExample.wrl" "../../Weapons/Missiles/HarpoonExample.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/HarpoonExample.wrl" '>
203                 <Shape>
204                      <Text string='"HarpoonPrototype" "is a prototype declaration file" "" "To see an example scene" "click on this text and view" "HarpoonExample"'>
205                           <FontStyle justify='"MIDDLE" "MIDDLE"'/>
206                      </Text>
207                      <Appearance>
208                           <Material diffuseColor='0.4 0.4 0.4'/>
209                      </Appearance>
210                 </Shape>
211            </Anchor>
212       </Scene>
213  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: AFTFIN, BACKFIN, BANDS, BFIN, BOOSTER, BOOSTERFIN, BOOSTSECT, CONE, EXHAUST, EXHAUSTCLOCK, EXHINT, FIN, FINCOLOR, Flames, MIDFIN, MISSILEBODY, RGMCLOCK, RGMCOLOR, RGMSOUND, RGMSSM, TimeFilter2

Index for ProtoDeclare definition: RGM84D
-->
X3D Tooltips element index: Anchor, Appearance, AudioClip, Background, Color, connect, Coordinate, Cylinder, Extrusion, field, FontStyle, Group, head, IndexedFaceSet, IS, Material, meta, PositionInterpolator, ProtoBody, ProtoDeclare, ProtoInterface, ROUTE, Scene, Script, Shape, Sound, Text, TimeSensor, Transform, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

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

TimeFilter2
Script
startEventTime
SFTime

ROUTE
event to
(1)
RGMCLOCK
TimeSensor
set_startTime
SFTime
then
 
 
 
RGMCLOCK
TimeSensor
startTime
SFTime

ROUTE
event to
(2)
RGMSOUND
AudioClip
startTime
SFTime
  then
 
 
 
RGMCLOCK
TimeSensor
stopTime
SFTime

ROUTE
event to
(2)
RGMSOUND
AudioClip
set_stopTime
SFTime
TimeFilter2
Script
startEventTime
SFTime

ROUTE
event to
(1)
EXHAUSTCLOCK
TimeSensor
set_startTime
SFTime
then
 
 
 
EXHAUSTCLOCK
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
EXHINT
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
EXHINT
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(3)
EXHAUST
Transform
set_scale
SFVec3f

line 202
Anchor
description='Harpoon Example' 
User-interaction hint for this node. 

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

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/HarpoonPrototypeIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/HarpoonPrototype.x3d -->

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

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