X3D Model Documentation: MissileExplosionPrototype.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=' MissileExplosionPrototype.x3d '/>
  6            <meta name='descriptioncontent='Simple prototype for an Anti-Ship Missile (ASM) explosion.'/>
  7            <meta name='creatorcontent='James Harney'/>
  8            <meta name='createdcontent='25 August 2001'/>
  9            <meta name='modifiedcontent='28 November 2019'/>
 10            <meta name='referencecontent='http://www.planetnine.com'/>
 11            <meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/Savage/CruiserUnitedStates/Cruiser.x3d '/>
 12            <meta name='referencecontent=' www.specialoperations.com/multimedia/sounds.html/exp03.au ' />
 13            <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 '/>
 14            <meta name='accessRightscontent=' soundpermissions.html '/>
 15            <meta name='referencecontent='explosion.png'/>
 16            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/MissileExplosionPrototype.x3d '/>
 17            <meta name='generatorcontent='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 18            <meta name='licensecontent='../../license.html'/>
 19       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: EXPCLOCK, EXPINTERP, EXPLOSION, explosion, EXPSHAPE, IMPACT, TimeFilter

Index for ProtoDeclare definition: ASMEXPLOSION
-->
 20       <Scene>
 21            <WorldInfo title='MissileExplosionPrototype.x3d'/>
 22            <ProtoDeclare name='ASMEXPLOSION'>
 23                 <ProtoInterface>
 24                      <field name='STARTEXPLOSIONtype='SFBoolaccessType='inputOnly'/>
 25                      <field name='THETIMEtype='SFTimeaccessType='inputOnly'/>
 26                 </ProtoInterface>
 27                 <ProtoBody>
 28 
                    <!-- ROUTE information for EXPLOSION node:  [from EXPINTERP.value_changed to set_scale ] -->
                    <Transform DEF='EXPLOSIONscale='.05 .05 .05'>
 29                           <Shape>
 30                                <Sphere DEF='EXPSHAPEradius='25'/>
 31                                <Appearance>
 32                                     <!-- explosion.png is from the Pearl Harbor scene from www.planetnine.com. -->
 33                                     <ImageTexture DEF='explosion'   url=' "explosion.png " "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/explosion.png " '/>
 34                                </Appearance>
 35                           </Shape>
 36                           <!-- Note, explosion delay is hard coded into script. Must modify if you don't want a 28 sec delay to start. -->
 37 
                         <!-- ROUTE information for TimeFilter node:  [from startEventTime to EXPCLOCK.set_startTime ] [from startEventTime to IMPACT.set_startTime ] -->
                         <Script DEF='TimeFilter'>
 38                                <field name='setStarttype='SFBoolaccessType='inputOnly'/>
 39                                <field name='startEventTimetype='SFTimeaccessType='outputOnly'/>
 40                                <field name='InputTimetype='SFTimeaccessType='inputOnly'/>
 41                                <IS>
 42                                     <connect nodeField='setStartprotoField='STARTEXPLOSION'/>
 43                                     <connect nodeField='InputTimeprotoField='THETIME'/>
 44                                </IS>
  <![CDATA[
            
ecmascript:


function setStart ( value, InputTime ) {
                         
	startEventTime = InputTime + 28 ;
	
}

          
]]>
 46                           </Script>
 47                           <!-- Used with permission. See soundpermissions.html for details. -->
 48                           <Sound maxBack='50000maxFront='50000'>
 49 
                              <!-- ROUTE information for IMPACT node:  [from TimeFilter.startEventTime to set_startTime ] -->
                              <AudioClip DEF='IMPACTdescription='Explosion'   url=' "EXP03.wav" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/EXP03.wav" '/>
 50                           </Sound>
 51                      </Transform>
 52 
                    <!-- ROUTE information for EXPCLOCK node:  [from TimeFilter.startEventTime to set_startTime ] [from fraction_changed to EXPINTERP.set_fraction ] -->
                    <TimeSensor DEF='EXPCLOCKcycleInterval='16'/>
 53 
                    <!-- ROUTE information for EXPINTERP node:  [from EXPCLOCK.fraction_changed to set_fraction ] [from value_changed to EXPLOSION.set_scale ] -->
                    <PositionInterpolator DEF='EXPINTERPkey='0 .25 .5 1keyValue='1 1 1 2.5 2.5 2.5 3 3 3 .01 .01 .01'/>
 54                      < ROUTE  fromNode='TimeFilter' fromField='startEventTime' toNode='EXPCLOCK' toField='set_startTime'/>
 55                      < ROUTE  fromNode='TimeFilter' fromField='startEventTime' toNode='IMPACT' toField='set_startTime'/>
 56                      < ROUTE  fromNode='EXPCLOCK' fromField='fraction_changed' toNode='EXPINTERP' toField='set_fraction'/>
 57                      < ROUTE  fromNode='EXPINTERP' fromField='value_changed' toNode='EXPLOSION' toField='set_scale'/>
 58                 </ProtoBody>
 59            </ProtoDeclare>
 60            <Background skyColor='0.604 0.753 0.804'/>
 61            <Anchor description='Multiple Explosion Exampleparameter='"target=_blank"'   url=' "MultipleExplosionExample.wrl" "../../Weapons/Missiles/MultipleExplosionExample.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/MultipleExplosionExample.wrl" "MultipleExplosionExample.x3d" "../../Weapons/Missiles/MultipleExplosionExample.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/MultipleExplosionExample.x3d" '>
 62                 <Shape>
 63                      <Text string='"MissileExplosionPrototype" "is a prototype declaration file" "" "To see an example scene" "click on this text and view" "MissileExplosionExample"'>
 64                           <FontStyle justify='"MIDDLE" "MIDDLE"'/>
 65                      </Text>
 66                      <Appearance/>
 67                 </Shape>
 68            </Anchor>
 69       </Scene>
 70  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: EXPCLOCK, EXPINTERP, EXPLOSION, explosion, EXPSHAPE, IMPACT, TimeFilter

Index for ProtoDeclare definition: ASMEXPLOSION
-->
X3D Tooltips element index: Anchor, Appearance, AudioClip, Background, connect, field, FontStyle, head, ImageTexture, IS, meta, PositionInterpolator, ProtoBody, ProtoDeclare, ProtoInterface, ROUTE, Scene, Script, Shape, Sound, Sphere, Text, TimeSensor, Transform, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

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

TimeFilter
Script
startEventTime
SFTime

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

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

ROUTE
event to
(3)
EXPLOSION
Transform
set_scale
SFVec3f
TimeFilter
Script
startEventTime
SFTime

ROUTE
event to
(1)
IMPACT
AudioClip
set_startTime
SFTime

line 61
Anchor
description='Multiple Explosion 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/MissileExplosionPrototypeIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/MissileExplosionPrototype.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. -->