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=' WheelsFrontPrototype.x3d '/> |
6 | <meta name='description' content='This prototype performs raising and lowering front wheels and axle. The clickable axle triggers an animation based on the boolean.'/> |
7 | <meta name='creator' content='Etsuko Lippi, Jane Wu'/> |
8 | <meta name='created' content='11 July 2001'/> |
9 | <meta name='modified' content='20 October 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/WheelsFrontPrototype.x3d '/> |
12 | <meta name='subject' content='front wheels prototype, gear up and down'/> |
13 | <meta name='license' content='../../license.html'/> |
14 | </head> |
15 | <Scene> |
16 | <WorldInfo title='WheelsFrontPrototype.x3d'/> |
17 | <ProtoDeclare name='WheelsFront'> |
18 | <ProtoInterface> |
19 |
<field name='gearup' type='SFBool' accessType='inputOnly'
appinfo='boolean eventIn: true = wheels up false = wheels down.'/> |
20 | <field name='animationStartTime' type='SFTime' accessType='inputOnly'/> |
21 | <field name='gearupOut' type='SFBool' accessType='outputOnly'/> |
22 | <field name='traceEnabled' type='SFBool' value='false' accessType='initializeOnly'/> |
23 | </ProtoInterface> |
24 | <ProtoBody> |
25 | <Group> |
26 |
<!-- ROUTE information for WheelsFrontAxleTransform node:
[from GearUpDownInterpolator.value_changed to set_rotation
]
-->
<Transform DEF='WheelsFrontAxleTransform' center='0 3 0'> |
27 | <Group> |
28 | <!-- wheels axis connecting to fuselage --> |
29 |
<!-- ROUTE information for WheelTransform node:
[from WheelInterpolator.value_changed to set_rotation
]
-->
<Transform DEF='WheelTransform'> |
30 | <Transform scale='0.3 0.3 0.3'> |
31 | <Transform rotation='0 1 0 1.571'> |
32 | <Shape DEF='wheel'> |
33 | <Appearance> |
34 | <Material DEF='black1' diffuseColor='0 0 0' shininess='0.125' specularColor='0.2 0.2 0.2'/> |
35 | </Appearance> |
36 | <Extrusion creaseAngle='3.14' crossSection='0.00 1.30 .494 1.196 .923 .923 1.196 .494 1.30 0.00 1.196 -.494 .923 -.923 .494 -1.196 0.00 -1.30' spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/> |
37 | </Shape> |
38 | <Shape DEF='inside_wheel'> |
39 | <Appearance> |
40 | |
41 | </Appearance> |
42 | <Extrusion crossSection='0.00 1.30 0.10 1.30 0.10 0.00 0.10 -1.30 0.00 -1.30 0.00 0.00 0.00 1.30' spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/> |
43 | </Shape> |
44 | </Transform> |
45 | <Transform rotation='0 1 0 1.571'> |
46 | <Shape> |
47 | <Appearance> |
48 | <Material USE='white1'/> |
49 | </Appearance> |
50 | <Extrusion crossSection='-0.10 1.30 0.00 1.30 0.00 0.00 0.00 -1.30 -0.10 -1.30 -0.10 0.00 -0.10 1.30' spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/> |
51 | </Shape> |
52 | </Transform> |
53 | <Transform rotation='0 1 0 1.571'> |
54 | <Shape> |
55 | <Appearance> |
56 | <Material diffuseColor='0 0.25 0.5'/> |
57 | </Appearance> |
58 | <Extrusion crossSection='-0.30 1.30 -0.10 1.30 -0.10 0.00 -0.10 -1.30 -0.30 -1.30 -0.30 0.00 -0.30 1.30' spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/> |
59 | </Shape> |
60 | </Transform> |
61 | </Transform> |
62 | <Transform translation='0 0 0.30'> |
63 |
<!-- Inline
Hub is a DEF node that has 3 USE nodes: USE_1, USE_2, USE_3 --> <Inline DEF='Hub' url=' "Hub.wrl" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18/Hub.wrl" "Hub.x3d" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18/Hub.x3d" '/> |
64 | </Transform> |
65 | <Transform translation='0 0 -0.30'> |
66 | <Inline USE='Hub'/> |
67 | </Transform> |
68 |
<!-- ROUTE information for WheelTouchSensor node:
[from isOver to Clock.set_enabled
]
-->
<TouchSensor DEF='WheelTouchSensor' description='click to retract'/> |
69 |
<!-- ROUTE information for Clock node:
[from WheelTouchSensor.isOver to set_enabled
]
[from fraction_changed to WheelInterpolator.set_fraction
]
-->
<TimeSensor DEF='Clock' cycleInterval='0.5' enabled='false' loop='true'/> |
70 |
<!-- ROUTE information for WheelInterpolator node:
[from Clock.fraction_changed to set_fraction
]
[from value_changed to WheelTransform.set_rotation
]
-->
<OrientationInterpolator DEF='WheelInterpolator' key='0 0.5 1.0' keyValue='0 0 1 0.0 0 0 1 3.14 0 0 1 6.28'/> |
71 | < ROUTE fromNode='WheelTouchSensor' fromField='isOver' toNode='Clock' toField='set_enabled'/> |
72 | < ROUTE fromNode='Clock' fromField='fraction_changed' toNode='WheelInterpolator' toField='set_fraction'/> |
73 | < ROUTE fromNode='WheelInterpolator' fromField='value_changed' toNode='WheelTransform' toField='set_rotation'/> |
74 | <Transform scale='0.3 0.3 0.3' translation='0 0 1.5'> |
75 | <Transform rotation='0 1 0 1.571'> |
76 | <Shape DEF='wheel2'> |
77 | <Appearance> |
78 | <Material DEF='black' diffuseColor='0 0 0' shininess='0.125' specularColor='0.2 0.2 0.2'/> |
79 | </Appearance> |
80 | <Extrusion creaseAngle='3.14' crossSection='0.00 1.30 .494 1.196 .923 .923 1.196 .494 1.30 0.00 1.196 -.494 .923 -.923 .494 -1.196 0.00 -1.30' spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/> |
81 | </Shape> |
82 | <Shape DEF='inside_wheel2'> |
83 | <Appearance> |
84 | |
85 | </Appearance> |
86 | <Extrusion crossSection='0.00 1.30 0.10 1.30 0.10 0.00 0.10 -1.30 0.00 -1.30 0.00 0.00 0.00 1.30' spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/> |
87 | </Shape> |
88 | </Transform> |
89 | <Transform rotation='0 1 0 1.571'> |
90 | <Shape> |
91 | <Appearance> |
92 | <Material USE='white'/> |
93 | </Appearance> |
94 | <Extrusion crossSection='-0.10 1.30 0.00 1.30 0.00 0.00 0.00 -1.30 -0.10 -1.30 -0.10 0.00 -0.10 1.30' spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/> |
95 | </Shape> |
96 | </Transform> |
97 | <Transform rotation='0 1 0 1.571'> |
98 | <Shape> |
99 | <Appearance> |
100 | <Material diffuseColor='0 0.25 0.5'/> |
101 | </Appearance> |
102 | <Extrusion crossSection='-0.30 1.30 -0.10 1.30 -0.10 0.00 -0.10 -1.30 -0.30 -1.30 -0.30 0.00 -0.30 1.30' spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/> |
103 | </Shape> |
104 | </Transform> |
105 | </Transform> |
106 | <Transform translation='0 0 1.80'> |
107 | <Inline USE='Hub'/> |
108 | </Transform> |
109 | <Transform translation='0 0 1.20'> |
110 | <Inline USE='Hub'/> |
111 | </Transform> |
112 | </Transform> |
113 | </Group> |
114 | <Group> |
115 | <Transform> |
116 | <Transform translation='0 0.55 0.75'> |
117 | <Shape> |
118 | |
119 | <Material ambientIntensity='0.3' diffuseColor='0.3 0.3 0.3' shininess='0.20' specularColor='0.50 0.50 0.60'/> |
120 | </Appearance> |
121 | <Cylinder height='1' radius='0.08'/> |
122 | </Shape> |
123 | </Transform> |
124 | <Transform rotation='1 0 0 1.57' scale='0.7 0.7 0.7' translation='0 0 1'> |
125 | <!-- Axis for wheelsFront --> |
126 | <Shape> |
127 | <Appearance USE='axis'/> |
128 | <Cylinder radius='0.1'/> |
129 | </Shape> |
130 | </Transform> |
131 | <Transform rotation='1 0 0 1.57' scale='0.7 0.7 0.7' translation='0 0 0.75'> |
132 | <!-- Joint --> |
133 | <Shape> |
134 | <Appearance USE='axis'/> |
135 | <Cylinder height='0.4' radius='0.15'/> |
136 | </Shape> |
137 | </Transform> |
138 | <Transform scale='0.7 0.7 0.7' translation='0 1.5 0.75'> |
139 | <!-- main axle for front wheels --> |
140 | <Shape> |
141 | |
142 | <Material diffuseColor='1.0 1.0 1.0'/> |
143 | </Appearance> |
144 | <Cylinder height='3' radius='0.25'/> |
145 | </Shape> |
146 | </Transform> |
147 | <Transform rotation='0 0 -1 1.05' scale='0.7 0.7 0.7' translation='0.68 1.5 0.75'> |
148 | <!-- assistant axle for front wheels --> |
149 | <Shape> |
150 | <Appearance USE='mainAxle'/> |
151 | <Cylinder radius='0.2'/> |
152 | </Shape> |
153 | </Transform> |
154 | <Transform rotation='0 0 -1 1.05' scale='0.7 0.7 0.7' translation='1.8 2.15 0.75'> |
155 | <!-- assistant axle for front wheels --> |
156 | <Shape> |
157 | <Appearance USE='mainAxle'/> |
158 | <Cylinder radius='0.3'/> |
159 | </Shape> |
160 | </Transform> |
161 | </Transform> |
162 | </Group> |
163 |
<!-- ROUTE information for GearUpDownScript node:
[from ClockAxleGearUpDown.fraction_changed to set_fraction
]
[from clockStartTime to ClockAxleGearUpDown.set_startTime
]
[from gearupOut to ClockAxleGearUpDown.set_enabled
]
[from keyValue to GearUpDownInterpolator.set_keyValue
]
-->
<Script DEF='GearUpDownScript'> |
164 |
<field name='gearup' type='SFBool' accessType='inputOnly'
appinfo='eventIn: boolean true: wheels up false: wheels down'/> |
165 | <field name='gearupOut' type='SFBool' accessType='outputOnly'/> |
166 | <field name='keyValue' type='MFRotation' accessType='outputOnly'/> |
167 | <field name='kV1' type='SFRotation' accessType='initializeOnly'/> |
168 | <field name='kV2' type='SFRotation' accessType='initializeOnly'/> |
169 | <field name='kV3' type='SFRotation' accessType='initializeOnly'/> |
170 | <field name='set_fraction' type='SFFloat' accessType='inputOnly'/> |
171 | <field name='animationStartTime' type='SFTime' accessType='inputOnly'/> |
172 | <field name='clockStartTime' type='SFTime' accessType='outputOnly'/> |
173 | <field name='traceEnabled' type='SFBool' accessType='initializeOnly'/> |
174 | <IS> |
175 | <connect nodeField='gearup' protoField='gearup'/> |
176 | <connect nodeField='animationStartTime' protoField='animationStartTime'/> |
177 | <connect nodeField='gearupOut' protoField='gearupOut'/> |
178 | <connect nodeField='traceEnabled' protoField='traceEnabled'/> |
179 | </IS> |
<![CDATA[
ecmascript: function gearup(value, timeStamp) { if (value == true) //Gear UP { tracePrint ('[GearUp] ' ); tracePrint ('value = ' + value); gearupOut = true; kV1 = new SFRotation (new SFVec3f (0, 0, 1), 0.0); kV2 = new SFRotation (new SFVec3f (0, 0, 1), 0.79); kV3 = new SFRotation(new SFVec3f (0, 0, 1), 1.70); keyValue = new MFRotation(kV1, kV2, kV3); //tracePrint ('[keyValue = ]' + keyValue); } else //Gear Down { tracePrint ('[GearDown] ' ); tracePrint ('value = ' + value); gearupOut = true; keyValue = new MFRotation(kV3, kV2, kV1); //tracePrint ('[keyValue = ]' + keyValue); } } function set_fraction (value, timeStamp) { //tracePrint('time fraction = ' + value); } function animationStartTime(value, timeStamp) { tracePrint('The Start Time is: ' + value); clockStartTime = value; } function tracePrint (outputString) { if (traceEnabled) Browser.println ('[WheelsFrontPrototype] ' + outputString); }
]]>
|
|
181 | </Script> |
182 | </Transform> |
183 | <Viewpoint description='Front Wheels Side View Point'/> |
184 | <Viewpoint description='Front Wheels View Point' orientation='.2 -.97 .138 1.1899' position='-3.1 -.1 2.3'/> |
185 |
<!-- ROUTE information for GearUpDownInterpolator node:
[from GearUpDownScript.keyValue to set_keyValue
]
[from ClockAxleGearUpDown.fraction_changed to set_fraction
]
[from value_changed to WheelsFrontAxleTransform.set_rotation
]
-->
<OrientationInterpolator DEF='GearUpDownInterpolator' key='0 0.5 1.0' keyValue='0 0 1 0.0 0 0 1 0.79 0 0 1 1.70'/> |
186 |
<!-- ROUTE information for ClockAxleGearUpDown node:
[from GearUpDownScript.clockStartTime to set_startTime
]
[from GearUpDownScript.gearupOut to set_enabled
]
[from fraction_changed to GearUpDownInterpolator.set_fraction
]
[from fraction_changed to GearUpDownScript.set_fraction
]
-->
<TimeSensor DEF='ClockAxleGearUpDown' cycleInterval='4'/> |
187 | < ROUTE fromNode='GearUpDownScript' fromField='clockStartTime' toNode='ClockAxleGearUpDown' toField='set_startTime'/> |
188 | < ROUTE fromNode='GearUpDownScript' fromField='gearupOut' toNode='ClockAxleGearUpDown' toField='set_enabled'/> |
189 | < ROUTE fromNode='GearUpDownScript' fromField='keyValue' toNode='GearUpDownInterpolator' toField='set_keyValue'/> |
190 | < ROUTE fromNode='ClockAxleGearUpDown' fromField='fraction_changed' toNode='GearUpDownInterpolator' toField='set_fraction'/> |
191 | < ROUTE fromNode='ClockAxleGearUpDown' fromField='fraction_changed' toNode='GearUpDownScript' toField='set_fraction'/> |
192 | < ROUTE fromNode='GearUpDownInterpolator' fromField='value_changed' toNode='WheelsFrontAxleTransform' toField='set_rotation'/> |
193 | </Group> |
194 | </ProtoBody> |
195 | </ProtoDeclare> |
196 | <!-- ============================= --> |
197 | <Background skyColor='0.7 0.7 0.7'/> |
198 | <Anchor description='WheelsFrontExample' parameter='"target=_blank"' url=' "WheelsFrontExample.wrl" "../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontExample.wrl" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontExample.wrl" "WheelsFrontExample.x3d" "../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontExample.x3d" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontExample.x3d" '> |
199 | <Shape> |
200 | <Text string='"WheelsFrontPrototype" "is a prototype definition file" "" "To see an example scene" "click on this text and view" "WheelsFrontExample"'> |
201 | <FontStyle justify='"MIDDLE" "MIDDLE"'/> |
202 | </Text> |
203 | <Appearance/> |
204 | </Shape> |
205 | </Anchor> |
206 | </Scene> |
207 | </X3D> |
Event Graph ROUTE Table entries with 9 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.
WheelTouchSensor
TouchSensor isOver SFBool |
Clock
TimeSensor set_enabled SFBool |
then
|
Clock
TimeSensor fraction_changed SFFloat |
WheelInterpolator
OrientationInterpolator set_fraction SFFloat |
then
|
WheelInterpolator
OrientationInterpolator value_changed SFRotation |
WheelTransform
Transform set_rotation SFRotation |
line 198
Anchor |
description='WheelsFrontExample' 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.
-->