| 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=' MultipleTimerExplodingBuildingPrototype.x3d '/> |
| 6 | <meta name='description' content='A simple exploding structure, experimenting with the "Hello World" of explosions - click on the silver chimney to trigger the explosion.'/> |
| 7 | <meta name='creator' content='Don Brutzman'/> |
| 8 | <meta name='created' content='1 January 2001'/> |
| 9 | <meta name='modified' content='28 November 2019'/> |
| 10 |
<meta name='Image' content='MultipleTimerExplodingBuildingExampleIntermediateAnimation.png' />
|
| 11 | <meta name='MovingImage' content='MultipleTimerExplodingBuildingVideo.mov'/> |
| 12 | <meta name='reference' content='Exploding building schematic layout diagram:'/> |
| 13 | <meta name='reference' content=' ExplodingBuildingLayout.pdf '/> |
| 14 | <meta name='reference' content='ExplodingBuildingLargeExample.wrl'/> |
| 15 | <meta name='reference' content='Rotation calculations performed using the Dizzy utility from Vapour Technologies by James Smith.'/> |
| 16 | <meta name='reference' content='http://www.vapourtech.com'/> |
| 17 | <meta name='reference' content='DIS-Java-VRML Working Group'/> |
| 18 | <meta name='reference' content='https://www.web3d.org/WorkingGroups/vrtp/dis-java-vrml'/> |
| 19 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Savage/Tools/Explosions/MultipleTimerExplodingBuildingPrototype.x3d '/> |
| 20 | <meta name='generator' content='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 21 | <meta name='license' content='../../license.html'/> |
| 22 | </head> |
| 23 | <Scene> |
| 24 | <WorldInfo title='MultipleTimerExplodingBuildingPrototype.x3d'/> |
| 25 | <ProtoDeclare name='Exploder' appinfo='Prototype to explode different pieces and parts in different ways.'> |
| 26 | <ProtoInterface> |
| 27 |
<field name='geometry' type='SFNode' accessType='initializeOnly'
appinfo='geometry node, to be used inside a Shape'> |
| 28 | <!-- initialization node (if any) goes here --> |
| 29 | </field> |
| 30 |
<field name='material' type='SFNode' accessType='initializeOnly'
appinfo='Material node for this geometry, to be used inside a Shape'> |
| 31 | <!-- initialization node (if any) goes here --> |
| 32 | </field> |
| 33 |
<field name='initialPosition' type='SFVec3f' value='0 0 0' accessType='initializeOnly'
appinfo='starting point'/> |
| 34 |
<field name='finalPosition' type='SFVec3f' value='0 0 0' accessType='initializeOnly'
appinfo='finish point'/> |
| 35 |
<field name='initialOrientation' type='SFRotation' value='0 1 0 0' accessType='initializeOnly'
appinfo='starting point orientation'/> |
| 36 |
<field name='finalOrientation' type='SFRotation' value='0 1 0 0' accessType='initializeOnly'
appinfo='finish point orientation'/> |
| 37 |
<field name='set_fraction' type='SFFloat' accessType='inputOnly'
appinfo='animation input'/> |
| 38 |
<field name='startTime' type='SFTime' value='0' accessType='inputOutput'
appinfo='animation trigger'/> |
| 39 | </ProtoInterface> |
| 40 | <ProtoBody> |
| 41 |
<!-- ROUTE information for LocationTransform node:
[from ProtoPositionInterpolatorCalculated.value_changed to translation
]
-->
<Transform DEF='LocationTransform'> |
| 42 | <IS> |
| 43 | <connect nodeField='translation' protoField='initialPosition'/> |
| 44 | </IS> |
| 45 |
<!-- ROUTE information for RotationTransform node:
[from ProtoOrientationInterpolatorCalculated.value_changed to rotation
]
-->
<Transform DEF='RotationTransform'> |
| 46 | <IS> |
| 47 | <connect nodeField='rotation' protoField='initialOrientation'/> |
| 48 | </IS> |
| 49 | <Shape DEF='AnimatedShape'> |
| 50 | <IS> |
| 51 | <connect nodeField='geometry' protoField='geometry'/> |
| 52 | </IS> |
| 53 | <Appearance DEF='AnimatedShapeAppearance'> |
| 54 | <IS> |
| 55 | <connect nodeField='material' protoField='material'/> |
| 56 | </IS> |
| 57 | </Appearance> |
| 58 | </Shape> |
| 59 | </Transform> |
| 60 | </Transform> |
| 61 |
<!-- ROUTE information for ProtoAnimationScript node:
[from position_changeds to ProtoPositionInterpolatorCalculated.keyValue
]
[from rotationValues to ProtoOrientationInterpolatorCalculated.keyValue
]
[from runTime to ProtoTimeSensor.cycleInterval
]
-->
<Script DEF='ProtoAnimationScript'> |
| 62 | <field name='initialPosition' type='SFVec3f' accessType='initializeOnly'/> |
| 63 | <field name='finalPosition' type='SFVec3f' accessType='initializeOnly'/> |
| 64 | <field name='initialOrientation' type='SFRotation' accessType='initializeOnly'/> |
| 65 | <field name='finalOrientation' type='SFRotation' accessType='initializeOnly'/> |
| 66 | <field name='runTime' type='SFTime' accessType='outputOnly'/> |
| 67 | <field name='position_changeds' type='MFVec3f' accessType='outputOnly'/> |
| 68 | <field name='rotationValues' type='MFRotation' accessType='outputOnly'/> |
| 69 | <!-- <field accessType='outputOnly' name='fraction_changed' type='SFFloat'/> --> |
| 70 | <IS> |
| 71 | <connect nodeField='initialPosition' protoField='initialPosition'/> |
| 72 | <connect nodeField='finalPosition' protoField='finalPosition'/> |
| 73 | <connect nodeField='initialOrientation' protoField='initialOrientation'/> |
| 74 | <connect nodeField='finalOrientation' protoField='finalOrientation'/> |
| 75 | </IS> |
<![CDATA[
ecmascript:
function initialize ()
{
dx = finalPosition.x - initialPosition.x;
dy = finalPosition.y - initialPosition.y;
dz = finalPosition.z - initialPosition.z;
// Browser.println ('dx=' + dx + ', dy=' + dy + ', dz=' + dz);
distance = Math.sqrt (dx*dx + dy*dy + dz*dz);
runTime = distance/20;
// Browser.println ('runTime = ' + runTime);
// Browser.println ('distance =' + distance);
quarterPoint = initialPosition.add (new SFVec3f ( dx/4, dy/4 + 0.707*distance, dz/4));
halfwaypoint = initialPosition.add (new SFVec3f ( dx/2, dy/2 + distance, dz/2));
three4thsPoint = initialPosition.add (new SFVec3f (3*dx/4, 3*dy/4 + 0.707*distance/2, 3*dz/4));
position_changeds = new MFVec3f (initialPosition, initialPosition, quarterPoint, halfwaypoint, three4thsPoint, finalPosition);
// Browser.println ('position_changeds =' + position_changeds);
rotationValues = new MFRotation (initialOrientation, finalOrientation);
// Browser.println ('initialPosition =' + initialPosition);
// Browser.println ('finalPosition =' + finalPosition);
// Browser.println ('position_changeds =' + position_changeds);
// Browser.println ('initialOrientation=' + initialOrientation);
// Browser.println ('finalOrientation =' + finalOrientation);
// Browser.println ('rotationValues=' + rotationValues);
}
]]>
|
|
| 77 | </Script> |
| 78 |
<!-- ROUTE information for ProtoTimeSensor node:
[from ProtoAnimationScript.runTime to cycleInterval
]
[from fraction_changed to ProtoPositionInterpolatorCalculated.set_fraction
]
[from fraction_changed to ProtoOrientationInterpolatorCalculated.set_fraction
]
-->
<TimeSensor DEF='ProtoTimeSensor'> |
| 79 | <IS> |
| 80 | <connect nodeField='startTime' protoField='startTime'/> |
| 81 | </IS> |
| 82 | </TimeSensor> |
| 83 |
<!-- ROUTE information for ProtoPositionInterpolatorCalculated node:
[from ProtoAnimationScript.position_changeds to keyValue
]
[from ProtoTimeSensor.fraction_changed to set_fraction
]
[from value_changed to LocationTransform.translation
]
-->
<PositionInterpolator DEF='ProtoPositionInterpolatorCalculated' key='0 0.2 0.4 0.6 0.8 1' keyValue='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'> |
| 84 | <IS> |
| 85 | <connect nodeField='set_fraction' protoField='set_fraction'/> |
| 86 | </IS> |
| 87 | </PositionInterpolator> |
| 88 |
<!-- ROUTE information for ProtoOrientationInterpolatorCalculated node:
[from ProtoAnimationScript.rotationValues to keyValue
]
[from ProtoTimeSensor.fraction_changed to set_fraction
]
[from value_changed to RotationTransform.rotation
]
-->
<OrientationInterpolator DEF='ProtoOrientationInterpolatorCalculated' key='0 1' keyValue='0 1 0 0 0 1 0 0'> |
| 89 | <IS> |
| 90 | <connect nodeField='set_fraction' protoField='set_fraction'/> |
| 91 | </IS> |
| 92 | </OrientationInterpolator> |
| 93 | < ROUTE fromNode='ProtoPositionInterpolatorCalculated' fromField='value_changed' toNode='LocationTransform' toField='translation'/> |
| 94 | < ROUTE fromNode='ProtoOrientationInterpolatorCalculated' fromField='value_changed' toNode='RotationTransform' toField='rotation'/> |
| 95 | < ROUTE fromNode='ProtoAnimationScript' fromField='position_changeds' toNode='ProtoPositionInterpolatorCalculated' toField='keyValue'/> |
| 96 | < ROUTE fromNode='ProtoAnimationScript' fromField='rotationValues' toNode='ProtoOrientationInterpolatorCalculated' toField='keyValue'/> |
| 97 | < ROUTE fromNode='ProtoAnimationScript' fromField='runTime' toNode='ProtoTimeSensor' toField='cycleInterval'/> |
| 98 | < ROUTE fromNode='ProtoTimeSensor' fromField='fraction_changed' toNode='ProtoPositionInterpolatorCalculated' toField='set_fraction'/> |
| 99 | < ROUTE fromNode='ProtoTimeSensor' fromField='fraction_changed' toNode='ProtoOrientationInterpolatorCalculated' toField='set_fraction'/> |
| 100 | </ProtoBody> |
| 101 | </ProtoDeclare> |
| 102 | <!-- ==================== --> |
| 103 | <Viewpoint description='Multiple Timer Exploding Building' position='0 0 12'/> |
| 104 | <Background groundAngle='1.57' groundColor='0.6 0.9 0.6 0.6 0.9 0.6' skyColor='0.6 0.6 0.9'/> |
| 105 | <Anchor description='MultipleTimerExplodingBuildingExample' parameter='"target=_blank"' url=' "MultipleTimerExplodingBuildingExample.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Explosions/MultipleTimerExplodingBuildingExample.x3d" "MultipleTimerExplodingBuildingExample.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Explosions/MultipleTimerExplodingBuildingExample.wrl" '> |
| 106 | <Shape> |
| 107 | <Text string='"MultipleTimerExplodingBuildingPrototype" "is a prototype definition file" "" "Click this text to see" "MultipleTimerExplodingBuildingExample"'> |
| 108 | <FontStyle justify='"MIDDLE" "MIDDLE"'/> |
| 109 | </Text> |
| 110 | <Appearance> |
| 111 | <Material diffuseColor='0.2 0.2 0.8'/> |
| 112 | </Appearance> |
| 113 | </Shape> |
| 114 | </Anchor> |
| 115 | </Scene> |
| 116 | </X3D> |
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.
| line 105
Anchor |
description='MultipleTimerExplodingBuildingExample' 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.
-->