X3D Model Documentation: Type209PrevezeDieselSubmarineAnimated.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=' Type209PrevezeDieselSubmarineAnimated.x3d '/>
  6            <meta name='creatorcontent='Alper SINAV'/>
  7            <meta name='createdcontent='1 August 2001'/>
  8            <meta name='modifiedcontent='28 November 2019'/>
  9            <meta name='descriptioncontent='This is a Type 209 Preveze Class Submarine From Turkish Submarine Fleet. It consists of a cylindric pressure hull, hydroplanes, rudder, propeller and superstructure with tower.'/>
 10            <meta name='creatorcontent='Alper SINAV'/>
 11            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Savage/Submarines/Various/Type209PrevezeDieselSubmarineAnimated.x3d '/>
 12            <meta name='generatorcontent='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 13            <meta name='licensecontent='../../license.html'/>
 14       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: BOWHYDPLANE, BOWPLANE, CLOCK, LBowPlaneRot, LowRudderRot, MOVER, PATH, PERISCOPE, PERISCOPETRANS, RBowPlaneRot, ROT, RUDDER, RUDDERANGLE, SUBMARINE, SUBOUT, SUBROTATE, SUBTRANS, Total, TURNER, UHFANTENNATRANS, UpRudderRot, Z90

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2
-->
 15       <Scene>
 16            <WorldInfo title='Type209PrevezeDieselSubmarineAnimated.x3d'/>
 17            <Background groundAngle='1.309 1.570796groundColor='0 0.4 0.4 0.25 0.6 0.6 0.1 0.4 0.4skyAngle='1.309 1.571skyColor='0.1 0.1 0.6 0.1 0.25 0.8 0.6 0.6 0.9'/>
 18            <Viewpoint description='Look away'/>
 19            <Viewpoint description='Listen Sonarposition='0 0 3'/>
 20            <!-- Following is construction of submarine -->
 21            <Transform scale='0.2 0.2 0.2'>
 22                 <!-- original rotation 0 0 1 -0.8 -->
 23                 <Transform DEF='ROT'>
 24 
                    <!-- ROUTE information for SUBTRANS node:  [from MOVER.value_changed to set_translation ] -->
                    <Transform DEF='SUBTRANS'>
 25 
                         <!-- ROUTE information for SUBROTATE node:  [from TURNER.value_changed to set_rotation ] -->
                         <Transform DEF='SUBROTATE'>
 26                                <Group DEF='SUBMARINE'>
 27                                     <!-- Main Pessure Hull and upper form super structure -->
 28                                     <Transform rotation='-1 0 0 1.57'>
 29                                          <Transform DEF='Z90rotation='0 0 1 1.57'>
 30                                               <Shape>
 31                                                    <Appearance DEF='SUBOUT'>
 32 
                                                       <!-- Material Total is a DEF node that has 10 USE nodes: USE_1, USE_2, USE_3, USE_4, USE_5, USE_6, USE_7, USE_8, USE_9, USE_10 -->
                                                       <Material DEF='TotaldiffuseColor='0.0 0.0 0.1emissiveColor='0.1 0.1 0.1specularColor='0.6 0.5 0.5'/>
 33                                                    </Appearance>
 34                                                    <Extrusion ccw='falsecreaseAngle='0.785crossSection='0 2 0.2 1.95 0.4 1.92 0.6 1.9 0.8 1.8 1 1.7 1 2.19 0.9 2.28 0.8 2.37 0.7 2.4 -0.7 2.4 -0.8 2.37 -0.9 2.28 -1 2.19 -1 1.7 -0.8 1.8 -0.6 1.9 -0.4 1.92 -0.2 1.95 0 2spine='0 -7 0 0 7 0'/>
 35                                               </Shape>
 36                                               <Shape>
 37                                                    <Appearance>
 38                                                         <Material USE='Total'/>
 39                                                    </Appearance>
 40                                                    <Cylinder height='14radius='2'/>
 41                                               </Shape>
 42                                               <Transform scale='2 2 2'>
 43                                                    <Shape>
 44                                                         <Appearance>
 45                                                              <Material USE='Total'/>
 46                                                         </Appearance>
 47                                                         <Extrusion creaseAngle='0.785crossSection='1.00 0.00 0.92 -0.38 0.71 -0.71 0.38 -0.92 0.00 -1.00 -0.38 -0.92 -0.71 -0.71 -0.92 -0.38 -1.00 -0.00 -0.92 0.38 -0.71 0.71 -0.38 0.92 0.00 1.00 0.38 0.92 0.71 0.71 0.92 0.38 1.00 0.00scale='0.3 0.3 1 1spine='0 7 0 0 3.5 0'/>
 48                                                    </Shape>
 49                                               </Transform>
 50                                               <Shape>
 51                                                    <Appearance>
 52                                                         <Material USE='Total'/>
 53                                                    </Appearance>
 54                                                    <Extrusion ccw='falsecreaseAngle='0.785crossSection='0 2 0.2 1.95 0.4 1.92 0.6 1.9 0.8 1.8 1 1.7 1 2.19 0.9 2.28 0.8 2.37 0.7 2.4 -0.7 2.4 -0.8 2.37 -0.9 2.28 -1 2.19 -1 1.7 -0.8 1.8 -0.6 1.9 -0.4 1.92 -0.2 1.95 0 2scale='1 1 0.1 0.1spine='0 -7 0 0 -9 0'/>
 55                                               </Shape>
 56                                          </Transform>
 57                                     </Transform>
 58                                     <!-- Head section of submarine MAIN BALAST TANKS -->
 59                                     <Transform center='0 0 14translation='7 0 0'>
 60                                          <Shape>
 61                                               <Sphere radius='2'/>
 62                                               <Appearance>
 63                                                    <Material USE='Total'/>
 64                                               </Appearance>
 65                                          </Shape>
 66                                     </Transform>
 67                                     <!-- Propeller copyright LtJg Burcin KAYALI -->
 68                                     <Transform scale='0.2 0.15 0.15translation='-14.2 0 0'>
 69                                          <Inline   url=' "Type209Propeller.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Submarines/Various/Type209Propeller.wrl" '/>
 70                                     </Transform>
 71                                     <!-- TOWER -->
 72                                     <Transform scale='4 0.5 1translation='-2 3 0'>
 73                                          <Shape>
 74                                               <Appearance>
 75                                                    <Material USE='Total'/>
 76                                               </Appearance>
 77                                               <Cylinder height='4radius='0.6'/>
 78                                          </Shape>
 79                                     </Transform>
 80                                     <!-- Retractable Mast Group -->
 81                                     <Transform DEF='PERISCOPETRANStranslation='-2 3 0'>
 82 
                                        <!-- Shape PERISCOPE is a DEF node that has 1 USE node: USE_1 -->
                                        <Shape DEF='PERISCOPE'>
 83                                               <Appearance>
 84                                                    <Material USE='Total'/>
 85                                               </Appearance>
 86                                               <Cylinder height='6radius='0.1'/>
 87                                          </Shape>
 88                                     </Transform>
 89                                     <Transform DEF='UHFANTENNATRANStranslation='-4 3 0'>
 90                                          <Shape USE='PERISCOPE'/>
 91                                     </Transform>
 92                                     <!-- Rudder and Hydro planes -->
 93                                     <Group DEF='RUDDER'>
 94                                          <Transform translation='-13 1 0'>
 95                                               <Transform DEF='LowRudderRot'>
 96                                                    <Transform scale='1 1 0.2'>
 97                                                         <Shape>
 98 
                                                            <!-- Cylinder BOWHYDPLANE is a DEF node that has 3 USE nodes: USE_1, USE_2, USE_3 -->
                                                            <Cylinder DEF='BOWHYDPLANEheight='1radius='0.5'/>
 99                                                              <Appearance>
100                                                                   <Material USE='Total'/>
101                                                              </Appearance>
102                                                         </Shape>
103                                                    </Transform>
104                                               </Transform>
105                                          </Transform>
106                                          <Transform translation='-13 -1 0'>
107                                               <Transform DEF='UpRudderRot'>
108                                                    <Transform scale='1 1 0.2'>
109                                                         <Shape>
110                                                              <Cylinder USE='BOWHYDPLANE'/>
111                                                              <Appearance>
112                                                                   <Material USE='Total'/>
113                                                              </Appearance>
114                                                         </Shape>
115                                                    </Transform>
116                                               </Transform>
117                                          </Transform>
118                                     </Group>
119                                     <Group DEF='BOWPLANE'>
120                                          <Transform translation='-12.5 0 1'>
121                                               <Transform rotation='1 0 0 1.57'>
122 
                                                  <!-- ROUTE information for RBowPlaneRot node:  [from RUDDERANGLE.value_changed to set_rotation ] -->
                                                  <Transform DEF='RBowPlaneRot'>
123                                                         <Transform scale='1 1 0.2'>
124                                                              <Shape>
125                                                                   <Cylinder USE='BOWHYDPLANE'/>
126                                                                   <Appearance>
127                                                                        <Material USE='Total'/>
128                                                                   </Appearance>
129                                                              </Shape>
130                                                         </Transform>
131                                                    </Transform>
132                                               </Transform>
133                                          </Transform>
134                                          <Transform translation='-12.5 0 -1'>
135                                               <Transform rotation='1 0 0 1.57'>
136 
                                                  <!-- ROUTE information for LBowPlaneRot node:  [from RUDDERANGLE.value_changed to set_rotation ] -->
                                                  <Transform DEF='LBowPlaneRotrotation='0 1 0 0.8'>
137                                                         <Transform scale='1 1 0.2'>
138                                                              <Shape>
139                                                                   <Cylinder USE='BOWHYDPLANE'/>
140                                                                   <Appearance>
141                                                                        <Material USE='Total'/>
142                                                                   </Appearance>
143                                                              </Shape>
144                                                         </Transform>
145                                                    </Transform>
146                                               </Transform>
147                                          </Transform>
148                                     </Group>
149                                </Group>
150                           </Transform>
151                           <Sound intensity='0.5maxBack='70maxFront='120minBack='50minFront='100'>
152                                <AudioClip description='sonar pingloop='true'   url=' "sonar.wav" "https://www.web3d.org/x3d/content/examples/Savage/Submarines/Various/sonar.wav" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/tone1.wav" '/>
153                           </Sound>
154                      </Transform>
155                 </Transform>
156            </Transform>
157 
          <!-- ROUTE information for CLOCK node:  [from fraction_changed to RUDDERANGLE.set_fraction ] [from fraction_changed to TURNER.set_fraction ] [from fraction_changed to MOVER.set_fraction ] -->
          <TimeSensor DEF='CLOCKcycleInterval='40loop='true'/>
158            <PositionInterpolator DEF='PATHkey='0 0.5 1keyValue='2 0 0 5 0 0 6 0 0'/>
159 
          <!-- ROUTE information for RUDDERANGLE node:  [from CLOCK.fraction_changed to set_fraction ] [from value_changed to RBowPlaneRot.set_rotation ] [from value_changed to LBowPlaneRot.set_rotation ] -->
          <OrientationInterpolator DEF='RUDDERANGLEkey='0 0.2 0.7keyValue='0 1 0 0 0 1 0 0.8 0 1 0 1.1'/>
160            < ROUTE  fromNode='CLOCK' fromField='fraction_changed' toNode='RUDDERANGLE' toField='set_fraction'/>
161            < ROUTE  fromNode='RUDDERANGLE' fromField='value_changed' toNode='RBowPlaneRot' toField='set_rotation'/>
162            < ROUTE  fromNode='RUDDERANGLE' fromField='value_changed' toNode='LBowPlaneRot' toField='set_rotation'/>
163 
          <!-- ROUTE information for MOVER node:  [from CLOCK.fraction_changed to set_fraction ] [from value_changed to SUBTRANS.set_translation ] -->
          <Script DEF='MOVER'>
164                 <field name='set_fractiontype='SFFloataccessType='inputOnly'/>
165                 <field name='value_changedtype='SFVec3faccessType='outputOnly'/>
166                 <field name='radiustype='SFFloatvalue='10accessType='initializeOnly'/>
167                 <field name='turnstype='SFFloatvalue='1accessType='initializeOnly'/>
  <![CDATA[
      
ecmascript:

function set_fraction ( fraction, eventTime ) {
	value_changed = new SFVec3f (radius * Math.sin( turns * fraction * 6.28 ), 0, radius * Math.cos( turns * fraction * 6.28 ));
}

    
]]>
169            </Script>
170 
          <!-- ROUTE information for TURNER node:  [from CLOCK.fraction_changed to set_fraction ] [from value_changed to SUBROTATE.set_rotation ] -->
          <Script DEF='TURNER'>
171                 <field name='set_fractiontype='SFFloataccessType='inputOnly'/>
172                 <field name='value_changedtype='SFRotationaccessType='outputOnly'/>
173                 <!-- <field accessType="initializeOnly" name="radius" type="SFFloat" value="1"/> <field accessType="initializeOnly" name="turns" type="SFFloat" value="1"/> -->
  <![CDATA[
      
ecmascript:

function set_fraction ( fraction, eventTime ) {
	value_changed = new SFRotation (0, 1, 0, fraction*6.28);
}

    
]]>
175            </Script>
176            < ROUTE  fromNode='CLOCK' fromField='fraction_changed' toNode='TURNER' toField='set_fraction'/>
177            < ROUTE  fromNode='TURNER' fromField='value_changed' toNode='SUBROTATE' toField='set_rotation'/>
178            < ROUTE  fromNode='CLOCK' fromField='fraction_changed' toNode='MOVER' toField='set_fraction'/>
179            < ROUTE  fromNode='MOVER' fromField='value_changed' toNode='SUBTRANS' toField='set_translation'/>
180       </Scene>
181  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: BOWHYDPLANE, BOWPLANE, CLOCK, LBowPlaneRot, LowRudderRot, MOVER, PATH, PERISCOPE, PERISCOPETRANS, RBowPlaneRot, ROT, RUDDER, RUDDERANGLE, SUBMARINE, SUBOUT, SUBROTATE, SUBTRANS, Total, TURNER, UHFANTENNATRANS, UpRudderRot, Z90

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2
-->
X3D Tooltips element index: Appearance, AudioClip, Background, Cylinder, Extrusion, field, Group, head, Inline, Material, meta, OrientationInterpolator, PositionInterpolator, ROUTE, Scene, Script, Shape, Sound, Sphere, TimeSensor, Transform, Viewpoint, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

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

CLOCK
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
RUDDERANGLE
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
RUDDERANGLE
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(2)
RBowPlaneRot
Transform
set_rotation
SFRotation
  then
 
 
 
RUDDERANGLE
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(2)
LBowPlaneRot
Transform
set_rotation
SFRotation
CLOCK
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
TURNER
Script
set_fraction
SFFloat
then
 
 
 
TURNER
Script
value_changed
SFRotation

ROUTE
event to
(2)
SUBROTATE
Transform
set_rotation
SFRotation
CLOCK
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
MOVER
Script
set_fraction
SFFloat
then
 
 
 
MOVER
Script
value_changed
SFVec3f

ROUTE
event to
(2)
SUBTRANS
Transform
set_translation
SFVec3f


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/Submarines/Various/Type209PrevezeDieselSubmarineAnimatedIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/Submarines/Various/Type209PrevezeDieselSubmarineAnimated.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)
-->

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