1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
|
3 | <X3D profile='Immersive' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'> |
4 | <head> |
5 | <meta name='title' content=' SuperCobraPrototype.x3d '/> |
6 | <meta name='description' content='Shows how to a prototype of Supercobra AH-1Z helicopter.'/> |
7 | <meta name='creator' content='Don Brutzman'/> |
8 | <meta name='created' content='16 January 2001'/> |
9 | <meta name='modified' content='1 December 2024'/> |
10 | <meta name=' TODO ' content=' fix model rotations '/> |
11 | <meta name='info' content='Avoided recursive loading of SuperCobraPrototype.x3d model by placing the prototype in a separate file, rather than cirular referencing. Problem detected using castle-model-viewer.'/> |
12 | <meta name='reference' content=' https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/Hughes500HoverInteriorMedium-cd21-no59-10sec.wav ' /> |
13 | <meta name='reference' content=' https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/FourBladeMainRotorPrototype.x3d '/> |
14 | <meta name='reference' content=' https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/RocketPod.x3d '/> |
15 | <meta name='reference' content=' https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/SkidLeft.x3d '/> |
16 | <meta name='reference' content=' https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/SkidRight.x3d '/> |
17 | <meta name='reference' content=' https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/TwoBladeTailRotorPrototype.x3d '/> |
18 | <meta name='reference' content=' https://www.fas.org/man/dod-101/sys/ac/ah-1.htm '/> |
19 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/SuperCobraPrototype.x3d '/> |
20 | <meta name='generator' content='X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
21 | <meta name='license' content='../../license.html'/> |
22 | </head> |
23 | <Scene> |
24 | <ExternProtoDeclare name='SuperCobra' appinfo='Prototype declaration for SuperCobra helicopter' url=' "SuperCobraPrototype.x3d#SuperCobra" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/SuperCobraPrototype.x3d#SuperCobra" "SuperCobraPrototype.wrl#SuperCobra" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/SuperCobraPrototype.wrl#SuperCobra" '/> |
25 | <!-- ================================================================================================================ --> |
26 | <!-- Example Helicopters --> |
27 | <Background skyColor='.4 .4 .6'/> |
28 | <Viewpoint description='Select Helicopter' orientation='0 1 0 1.57' position='14 3.2 0'/> |
29 | <Transform translation='0 6.5 0'> |
30 | <Billboard> |
31 | <Shape> |
32 | <Appearance> |
33 | <Material diffuseColor='0.9 0.9 0.2'/> |
34 | </Appearance> |
35 | <Text string='"Select SuperCobra Paint Scheme"'> |
36 | <FontStyle justify='"MIDDLE" "MIDDLE"'/> |
37 | </Text> |
38 | </Shape> |
39 | <Transform translation='0 -1.5 0'> |
40 | <Transform translation='-6 0 0'> |
41 |
<!-- ROUTE information for TOUCH_Green node:
[from isActive to EXAMPLE_SELECTION.touchedGreen
]
-->
<TouchSensor DEF='TOUCH_Green' description='touch for green material'/> |
42 | <Shape> |
43 | <Appearance> |
44 |
<!-- ROUTE information for MATERIAL_Green node:
[from EXAMPLE_SELECTION.greenSelectionColor to diffuseColor
]
-->
<Material DEF='MATERIAL_Green' diffuseColor='0 0.8 0'/> |
45 | </Appearance> |
46 | <Text string='"Green"'> |
47 | <FontStyle justify='"MIDDLE" "MIDDLE"'/> |
48 | </Text> |
49 | </Shape> |
50 | <Shape> |
51 | <Box size='3.5 1 .01'/> |
52 |
<!-- Appearance
TransparentMaterial is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
<Appearance DEF='TransparentMaterial'> |
53 | <Material transparency='1'/> |
54 | </Appearance> |
55 | </Shape> |
56 | </Transform> |
57 | <Transform> |
58 |
<!-- ROUTE information for TOUCH_Camouflage node:
[from isActive to EXAMPLE_SELECTION.touchedCamouflage
]
-->
<TouchSensor DEF='TOUCH_Camouflage' description='touch for camoflage material'/> |
59 | <Shape> |
60 | <Appearance> |
61 |
<!-- ROUTE information for MATERIAL_Camouflage node:
[from EXAMPLE_SELECTION.camouflageSelectionColor to diffuseColor
]
-->
<Material DEF='MATERIAL_Camouflage' diffuseColor='0.7 0.7 0'/> |
62 | </Appearance> |
63 | <Text string='"Camouflage"'> |
64 | <FontStyle justify='"MIDDLE" "MIDDLE"'/> |
65 | </Text> |
66 | </Shape> |
67 | <Shape> |
68 | <Box size='7 1 .01'/> |
69 | <Appearance USE='TransparentMaterial'/> |
70 | </Shape> |
71 | </Transform> |
72 | <Transform translation='6 0 0'> |
73 |
<!-- ROUTE information for TOUCH_Grey node:
[from isActive to EXAMPLE_SELECTION.touchedGrey
]
-->
<TouchSensor DEF='TOUCH_Grey' description='touch for grey material'/> |
74 | <Shape> |
75 | <Appearance> |
76 |
<!-- ROUTE information for MATERIAL_Grey node:
[from EXAMPLE_SELECTION.greySelectionColor to diffuseColor
]
-->
<Material DEF='MATERIAL_Grey'/> |
77 | </Appearance> |
78 | <Text string='"Grey"'> |
79 | <FontStyle justify='"MIDDLE" "MIDDLE"'/> |
80 | </Text> |
81 | </Shape> |
82 | <Shape> |
83 | <Box size='3 1 0.01'/> |
84 | <Appearance USE='TransparentMaterial'/> |
85 | </Shape> |
86 | </Transform> |
87 | </Transform> |
88 | </Billboard> |
89 | </Transform> |
90 |
<!-- ROUTE information for EXAMPLE_SWITCH node:
[from EXAMPLE_SELECTION.selection to whichChoice
]
-->
<Switch DEF='EXAMPLE_SWITCH' whichChoice='0'> |
91 | <Transform rotation='0 1 0 1.57'> |
92 | <Inline url=' "ExampleGreenCobra.x3d" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/ExampleGreenCobra.x3d" "ExampleGreenCobra.wrl" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/ExampleGreenCobra.wrl" '/> |
93 | </Transform> |
94 | <Transform rotation='0 1 0 1.57'> |
95 | <Inline url=' "ExampleCamouflageCobra.x3d" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/ExampleCamouflageCobra.x3d" "ExampleCamouflageCobra.wrl" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/ExampleCamouflageCobra.wrl" '/> |
96 | </Transform> |
97 | <Transform rotation='0 1 0 1.57'> |
98 | <Inline url=' "ExampleGreyCobra.x3d" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/ExampleGreyCobra.x3d" "ExampleGreyCobra.wrl" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/ExampleGreyCobra.wrl" '/> |
99 | </Transform> |
100 | </Switch> |
101 |
<!-- ROUTE information for EXAMPLE_SELECTION node:
[from TOUCH_Green.isActive to touchedGreen
]
[from TOUCH_Camouflage.isActive to touchedCamouflage
]
[from TOUCH_Grey.isActive to touchedGrey
]
[from greenSelectionColor to MATERIAL_Green.diffuseColor
]
[from camouflageSelectionColor to MATERIAL_Camouflage.diffuseColor
]
[from greySelectionColor to MATERIAL_Grey.diffuseColor
]
[from selection to EXAMPLE_SWITCH.whichChoice
]
-->
<Script DEF='EXAMPLE_SELECTION'> |
102 | <field name='touchedGreen' type='SFBool' accessType='inputOnly'/> |
103 | <field name='touchedCamouflage' type='SFBool' accessType='inputOnly'/> |
104 | <field name='touchedGrey' type='SFBool' accessType='inputOnly'/> |
105 | <field name='selection' type='SFInt32' accessType='outputOnly'/> |
106 | <field name='greenSelectionColor' type='SFColor' accessType='outputOnly'/> |
107 | <field name='camouflageSelectionColor' type='SFColor' accessType='outputOnly'/> |
108 | <field name='greySelectionColor' type='SFColor' accessType='outputOnly'/> |
<![CDATA[
ecmascript: function touchedGreen(value, ts) { selection = 0; greenSelectionColor = new SFColor(0, 0.8, 0); camouflageSelectionColor = new SFColor(0.8, 0, 0); greySelectionColor = new SFColor(0.8, 0, 0); } function touchedCamouflage(value, ts) { selection = 1; greenSelectionColor = new SFColor(0.8, 0, 0); camouflageSelectionColor = new SFColor(0, 0.8, 0); greySelectionColor = new SFColor(0.8, 0, 0); } function touchedGrey(value, ts) { selection = 2; greenSelectionColor = new SFColor(0.8, 0, 0); camouflageSelectionColor = new SFColor(0.8, 0, 0); greySelectionColor = new SFColor(0, 0.8, 0); }
]]>
|
|
110 | </Script> |
111 | < ROUTE fromNode='TOUCH_Green' fromField='isActive' toNode='EXAMPLE_SELECTION' toField='touchedGreen'/> |
112 | < ROUTE fromNode='TOUCH_Camouflage' fromField='isActive' toNode='EXAMPLE_SELECTION' toField='touchedCamouflage'/> |
113 | < ROUTE fromNode='TOUCH_Grey' fromField='isActive' toNode='EXAMPLE_SELECTION' toField='touchedGrey'/> |
114 | < ROUTE fromNode='EXAMPLE_SELECTION' fromField='greenSelectionColor' toNode='MATERIAL_Green' toField='diffuseColor'/> |
115 | < ROUTE fromNode='EXAMPLE_SELECTION' fromField='camouflageSelectionColor' toNode='MATERIAL_Camouflage' toField='diffuseColor'/> |
116 | < ROUTE fromNode='EXAMPLE_SELECTION' fromField='greySelectionColor' toNode='MATERIAL_Grey' toField='diffuseColor'/> |
117 | < ROUTE fromNode='EXAMPLE_SELECTION' fromField='selection' toNode='EXAMPLE_SWITCH' toField='whichChoice'/> |
118 | </Scene> |
119 | </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.
TOUCH_Camouflage
TouchSensor isActive SFBool |
EXAMPLE_SELECTION
Script touchedCamouflage SFBool |
then
|
EXAMPLE_SELECTION
Script camouflageSelectionColor SFColor |
MATERIAL_Camouflage
Material diffuseColor SFColor |
||
then
|
EXAMPLE_SELECTION
Script greenSelectionColor SFColor |
MATERIAL_Green
Material diffuseColor SFColor |
||||
then
|
EXAMPLE_SELECTION
Script greySelectionColor SFColor |
MATERIAL_Grey
Material diffuseColor SFColor |
||||
then
|
EXAMPLE_SELECTION
Script selection SFInt32 |
EXAMPLE_SWITCH
Switch whichChoice SFInt32 |
TOUCH_Green
TouchSensor isActive SFBool |
EXAMPLE_SELECTION
Script touchedGreen SFBool |
then
|
EXAMPLE_SELECTION
Script camouflageSelectionColor SFColor |
MATERIAL_Camouflage
Material diffuseColor SFColor |
||
then
|
EXAMPLE_SELECTION
Script greenSelectionColor SFColor |
MATERIAL_Green
Material diffuseColor SFColor |
||||
then
|
EXAMPLE_SELECTION
Script greySelectionColor SFColor |
MATERIAL_Grey
Material diffuseColor SFColor |
||||
then
|
EXAMPLE_SELECTION
Script selection SFInt32 |
EXAMPLE_SWITCH
Switch whichChoice SFInt32 |
TOUCH_Grey
TouchSensor isActive SFBool |
EXAMPLE_SELECTION
Script touchedGrey SFBool |
then
|
EXAMPLE_SELECTION
Script camouflageSelectionColor SFColor |
MATERIAL_Camouflage
Material diffuseColor SFColor |
||
then
|
EXAMPLE_SELECTION
Script greenSelectionColor SFColor |
MATERIAL_Green
Material diffuseColor SFColor |
||||
then
|
EXAMPLE_SELECTION
Script greySelectionColor SFColor |
MATERIAL_Grey
Material diffuseColor SFColor |
||||
then
|
EXAMPLE_SELECTION
Script selection SFInt32 |
EXAMPLE_SWITCH
Switch whichChoice SFInt32 |
<!--
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.
-->