| 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=' CanopyExample.x3d '/> |
| 6 | <meta name='description' content='Animation example from Canopy Prototype. Clicking canopy triggers animation for open and close performance.'/> |
| 7 | <meta name='creator' content='Etsuko Lippi'/> |
| 8 | <meta name='created' content='18 October 2001'/> |
| 9 | <meta name='modified' content='28 November 2019'/> |
| 10 | <meta name='generator' content='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 11 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/CanopyExample.x3d '/> |
| 12 | <meta name='subject' content='cockpit canopy animation example'/> |
| 13 | <meta name='license' content='../../license.html'/> |
| 14 | </head> |
| 15 | <Scene> |
| 16 | <WorldInfo title='CanopyExample.x3d'/> |
| 17 | <ExternProtoDeclare name='Canopy' url=' "CanopyPrototype.wrl#Canopy" "../../AircraftFixedWing/F18BlueAngelUnitedStates/CanopyPrototype.wrl#Canopy" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/CanopyPrototype.wrl#Canopy" "CanopyPrototype.x3d#Canopy" "../../AircraftFixedWing/F18BlueAngelUnitedStates/CanopyPrototype.x3d#Canopy" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/CanopyPrototype.x3d#Canopy" '> |
| 18 | <field name='canopyOpen' type='SFBool' accessType='inputOnly'/> |
| 19 | <field name='canopyOut' type='SFBool' accessType='outputOnly'/> |
| 20 | <field name='animationStartTime' type='SFTime' accessType='inputOnly'/> |
| 21 | <field name='traceEnabled' type='SFBool' accessType='initializeOnly'/> |
| 22 | </ExternProtoDeclare> |
| 23 | <Background skyColor='0.7 0.7 0.7'/> |
| 24 | <Group> |
| 25 |
<!-- ROUTE information for CanopyTouchSensor node:
[from touchTime to CP.animationStartTime
]
[from isActive to ExampleSelectionScript.enabled
]
-->
<TouchSensor DEF='CanopyTouchSensor' description='canopy open/close'/> |
| 26 | <Transform DEF='Canopy'> |
| 27 |
<!-- ROUTE information for ExampleSelectionScript node:
[from CanopyTouchSensor.isActive to enabled
]
[from status to CP.canopyOpen
]
-->
<Script DEF='ExampleSelectionScript'> |
| 28 | <field name='landed' type='SFInt32' value='-1' accessType='initializeOnly'/> |
| 29 | <field name='enabled' type='SFBool' accessType='inputOnly'/> |
| 30 | <field name='status' type='SFBool' accessType='outputOnly'/> |
<![CDATA[
ecmascript:
function tracePrint (outputString)
{
if (traceEnabled) Browser.println ('[trace] ' + outputString);
}
function enabled(value, timeStamp)
{
tracePrint('enabled = ' + value);
if (value == true)
{
if (landed == -1)
{
status = false;
landed = 0;
}
if (landed == 0)
{
if (status)
{
status = false;
}
else
{
status = true;
}
}
else
{
landed = 0;
return;
}
}
}
]]>
|
|
| 32 | </Script> |
| 33 | </Transform> |
| 34 |
<!-- ROUTE information for CP node:
[from CanopyTouchSensor.touchTime to animationStartTime
]
[from ExampleSelectionScript.status to canopyOpen
]
-->
<ProtoInstance name='Canopy' DEF='CP'> |
| 35 | <fieldValue name='traceEnabled' value='true'/> |
| 36 | </ProtoInstance> |
| 37 | </Group> |
| 38 | < ROUTE fromNode='CanopyTouchSensor' fromField='touchTime' toNode='CP' toField='animationStartTime'/> |
| 39 | < ROUTE fromNode='CanopyTouchSensor' fromField='isActive' toNode='ExampleSelectionScript' toField='enabled'/> |
| 40 | < ROUTE fromNode='ExampleSelectionScript' fromField='status' toNode='CP' toField='canopyOpen'/> |
| 41 | </Scene> |
| 42 | </X3D> |
Event Graph ROUTE Table entries with 3 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.
|
CanopyTouchSensor
TouchSensor touchTime SFTime |
CP
ProtoInstance animationStartTime SFTime |
|||||
|
CanopyTouchSensor
TouchSensor isActive SFBool |
ExampleSelectionScript
Script enabled SFBool |
then
|
ExampleSelectionScript
Script status SFBool |
CP
ProtoInstance canopyOpen SFBool |
|
CP
ProtoInstance Canopy |
No direct ROUTE connection found for events to/from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
<!--
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)
<ProtoInstance name='ProtoName'>
<field
name='fieldName'/> </ProtoInstance>
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->