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='title' content=' MissileExplosionPrototype.x3d '/> |
6 | <meta name='description' content='Simple prototype for an Anti-Ship Missile (ASM) explosion.'/> |
7 | <meta name='creator' content='James Harney'/> |
8 | <meta name='created' content='25 August 2001'/> |
9 | <meta name='modified' content='28 November 2019'/> |
10 | <meta name='reference' content='http://www.planetnine.com'/> |
11 | <meta name='reference' content=' https://www.web3d.org/x3d/content/examples/Savage/CruiserUnitedStates/Cruiser.x3d '/> |
12 | <meta name='reference' content=' www.specialoperations.com/multimedia/sounds.html/exp03.au ' /> |
13 | <meta name='reference' content=' 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='accessRights' content=' soundpermissions.html '/> |
15 |
<meta name='reference' content='explosion.png'![]() |
16 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/MissileExplosionPrototype.x3d '/> |
17 | <meta name='generator' content='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
18 | <meta name='license' content='../../license.html'/> |
19 | </head> |
20 | <Scene> |
21 | <WorldInfo title='MissileExplosionPrototype.x3d'/> |
22 | <ProtoDeclare name='ASMEXPLOSION'> |
23 | <ProtoInterface> |
24 | <field name='STARTEXPLOSION' type='SFBool' accessType='inputOnly'/> |
25 | <field name='THETIME' type='SFTime' accessType='inputOnly'/> |
26 | </ProtoInterface> |
27 | <ProtoBody> |
28 |
<!-- ROUTE information for EXPLOSION node:
[from EXPINTERP.value_changed to set_scale
]
-->
<Transform DEF='EXPLOSION' scale='.05 .05 .05'> |
29 | <Shape> |
30 | <Sphere DEF='EXPSHAPE' radius='25'/> |
31 | <Appearance> |
32 | <!-- explosion.png is from the Pearl Harbor scene from www.planetnine.com. --> |
33 |
<ImageTexture DEF='explosion'
url=' "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='setStart' type='SFBool' accessType='inputOnly'/> |
39 | <field name='startEventTime' type='SFTime' accessType='outputOnly'/> |
40 | <field name='InputTime' type='SFTime' accessType='inputOnly'/> |
41 | <IS> |
42 | <connect nodeField='setStart' protoField='STARTEXPLOSION'/> |
43 | <connect nodeField='InputTime' protoField='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='50000' maxFront='50000'> |
49 |
<!-- ROUTE information for IMPACT node:
[from TimeFilter.startEventTime to set_startTime
]
-->
<AudioClip DEF='IMPACT' description='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='EXPCLOCK' cycleInterval='16'/> |
53 |
<!-- ROUTE information for EXPINTERP node:
[from EXPCLOCK.fraction_changed to set_fraction
]
[from value_changed to EXPLOSION.set_scale
]
-->
<PositionInterpolator DEF='EXPINTERP' key='0 .25 .5 1' keyValue='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 Example' parameter='"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 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 |
EXPCLOCK
TimeSensor set_startTime SFTime |
then
|
EXPCLOCK
TimeSensor fraction_changed SFFloat |
EXPINTERP
PositionInterpolator set_fraction SFFloat |
then
|
EXPINTERP
PositionInterpolator value_changed SFVec3f |
EXPLOSION
Transform set_scale SFVec3f |
TimeFilter
Script startEventTime SFTime |
IMPACT
AudioClip set_startTime SFTime |
line 61
Anchor |
description='Multiple Explosion Example' User-interaction hint for this node. |
<!--
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)
<ProtoDeclare name='ProtoName'>
<field
name='fieldName'/> </ProtoDeclare>
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->