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='PropellerControlPanel.x3d'/> |
6 | <meta name='description' content='Controller buttons and slider for a propeller.'/> |
7 | <meta name='creator' content='Dan DeVos'/> |
8 | <meta name='translator' content='*if manually translating VRML-to-X3D, enter name of person translating here*'/> |
9 | <meta name='created' content='8 August 2002'/> |
10 | <meta name='modified' content='11 August 2024'/> |
11 | <meta name=' warning ' content=' mismatched typing in some ROUTEs still needs fixing '/> |
12 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/PropellerControlPanel.x3d'/> |
13 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
14 | <meta name='license' content='../license.html'/> |
15 | </head> |
16 | <Scene> |
17 | <WorldInfo title='PropellerControlPanel.x3d'/> |
18 | <Viewpoint description='Fan' position='1 0 10'/> |
19 | <Viewpoint description='Control Panel' position='-1 0 5'/> |
20 | <Viewpoint description='Watch Fan Spin' orientation='0 1 0 1.571' position='10 0 0'/> |
21 | <Viewpoint description='Remote Control' orientation='1 0 0 -1.571' position='0 3 20'/> |
22 | <Background groundColor='.3 .6 .4' skyColor='.6 .6 .9'/> |
23 | <!-- Rotating Fan --> |
24 | <Group DEF='MaterialGroup'> |
25 | <Shape> |
26 | <Sphere radius='.001'/> |
27 | |
28 | <Material diffuseColor='0.4 0.4 0.4' specularColor='0.4 0.4 0.6'/> |
29 | </Appearance> |
30 | </Shape> |
31 | <Shape> |
32 | <Sphere radius='.001'/> |
33 |
<!-- Appearance
LightGreyMetal is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
<Appearance DEF='LightGreyMetal'> |
34 | <Material diffuseColor='0.7 0.7 0.7' shininess='0.1' specularColor='0.9 0.9 0.9'/> |
35 | </Appearance> |
36 | </Shape> |
37 | </Group> |
38 | <Transform rotation='0 0 -1 1.571' translation='2 0 0'> |
39 | <Group DEF='RotatingFanGroup'> |
40 |
<!-- ROUTE information for Fan node:
[from FanPath.value_changed to set_rotation
]
-->
<Transform DEF='Fan'> |
41 | <Transform DEF='FanHub'> |
42 | <Shape DEF='FanHubMiddle'> |
43 | <Appearance USE='DarkBlueGreyMetal'/> |
44 | <Cylinder height='.4' radius='.25'/> |
45 | </Shape> |
46 | <Transform translation='0 .2 0'> |
47 | <Shape DEF='FanHubTop'> |
48 | <Sphere radius='.255'/> |
49 | <Appearance USE='DarkBlueGreyMetal'/> |
50 | </Shape> |
51 | </Transform> |
52 | </Transform> |
53 | <Transform DEF='RightFanBlade' rotation='1 0 0 -.2' scale='2 .1 .5' translation='1.8 0 0'> |
54 | |
55 | <Sphere/> |
56 | <Appearance USE='LightGreyMetal'/> |
57 | </Shape> |
58 | </Transform> |
59 | <Transform DEF='LeftFanBlade' rotation='1 0 0 .2' scale='2 .1 .5' translation='-1.8 0 0'> |
60 | <Shape USE='FanBlade'/> |
61 | </Transform> |
62 | </Transform> |
63 |
<!-- ROUTE information for FanClock node:
[from MotorAmp.fanCycleTime to set_cycleInterval
]
[from MotorButtonActionOn.fanOnButtonAction to set_cycleInterval
]
[from fraction_changed to FanPath.set_fraction
]
-->
<TimeSensor DEF='FanClock' startTime='10' stopTime='0.1'/> |
64 |
<!-- ROUTE information for FanPath node:
[from FanClock.fraction_changed to set_fraction
]
[from value_changed to Fan.set_rotation
]
-->
<OrientationInterpolator DEF='FanPath' key='0.0 0.50 1.0' keyValue='0.0 1.0 0.0 0.0 0.0 1.0 0.0 3.14 0.0 1.0 0.0 6.28'/> |
65 | </Group> |
66 | </Transform> |
67 | <!-- This is where the motor goes. --> |
68 | <Transform> |
69 | <Group DEF='MotorHousingGroup'> |
70 | <Transform> |
71 | <Shape> |
72 | <Box size='3.65 3.65 3.65'/> |
73 | <Appearance> |
74 | <Material/> |
75 | </Appearance> |
76 | </Shape> |
77 | </Transform> |
78 | </Group> |
79 | </Transform> |
80 | <!-- --> |
81 |
<!-- Group
ControlPanel is a DEF node that has 1 USE node: USE_1 -->
<Group DEF='ControlPanel'> |
82 | <!-- This switch is used to control the fan --> |
83 | <Transform scale='.2 .2 .2' translation='-1 -.3 1.825'> |
84 | <Group DEF='SwitchGroup'> |
85 | <Transform rotation='0 0 1 1.571'> |
86 | <Transform rotation='1 0 0 1.571'> |
87 | <Shape> |
88 | <Appearance USE='DarkBlueGreyMetal'/> |
89 | <Extrusion crossSection='0 1.2 0 1.0 -2 1.0 -2 -1.0 2 -1.0 2 1.0 0 1.0 0 1.2 2.2 1.2 2.2 -1.2 -2.2 -1.2 -2.2 1.2 0 1.2' spine='0 0 0 0 .5 0'/> |
90 | </Shape> |
91 | </Transform> |
92 | </Transform> |
93 | <Transform translation='0 -1.5 .251'> |
94 |
<!-- ROUTE information for SwitchTransform node:
[from SwitchPlaneSensor.translation_changed to set_translation
]
-->
<Transform DEF='SwitchTransform'> |
95 | <Shape DEF='SwitchNob'> |
96 | <Box size='2 1 .499'/> |
97 | <Appearance USE='LightGreyMetal'/> |
98 | </Shape> |
99 |
<!-- ROUTE information for SwitchPlaneSensor node:
[from translation_changed to SwitchTransform.set_translation
]
[from translation_changed to MotorAmp.switchPosition
]
-->
<PlaneSensor DEF='SwitchPlaneSensor' maxPosition='0 3'/> |
100 | <TouchSensor DEF='SwitchTouchSensor'/> |
101 | </Transform> |
102 | </Transform> |
103 | <Transform translation='0 0 .1'> |
104 | <Shape DEF='SwitchBack'> |
105 | <Box size='2 4 .2'/> |
106 | <Appearance USE='DarkBlueGreyMetal'/> |
107 | </Shape> |
108 | </Transform> |
109 | </Group> |
110 | </Transform> |
111 | <!-- Fan Status Display --> |
112 | <Transform translation='.5 -.5 1.83'> |
113 | <Group DEF='Display'> |
114 | <Transform translation='0 0 .01'> |
115 | <Shape> |
116 |
<!-- ROUTE information for SpeedDisplay node:
[from MotorAmp.displayFanSpeed to set_string
]
-->
<Text DEF='SpeedDisplay' string='"OFF"'> |
117 | <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.5'/> |
118 | </Text> |
119 | |
120 | <Material diffuseColor='0 0 0'/> |
121 | </Appearance> |
122 | </Shape> |
123 | </Transform> |
124 |
<!-- Shape
DisplayField is a DEF node that has 1 USE node: USE_1 -->
<Shape DEF='DisplayField'> |
125 | <Appearance> |
126 | <Material emissiveColor='0 1 1' transparency='.7'/> |
127 | </Appearance> |
128 | <Box size='2 .6 .01'/> |
129 | </Shape> |
130 | <Transform translation='0 .5 .01'> |
131 | <Shape> |
132 | <Text string='"Fan Status:"'> |
133 | <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.5'/> |
134 | </Text> |
135 | <Appearance USE='BlackText'/> |
136 | </Shape> |
137 | </Transform> |
138 | </Group> |
139 | </Transform> |
140 |
<!-- ROUTE information for MotorAmp node:
[from SwitchPlaneSensor.translation_changed to switchPosition
]
[from fanCycleTime to FanClock.set_cycleInterval
]
[from displayFanSpeed to SpeedDisplay.set_string
]
-->
<Script DEF='MotorAmp'> |
141 | <field name='switchPosition' type='SFVec3f' accessType='inputOnly'/> |
142 | <field name='fanCycleTime' type='SFTime' accessType='outputOnly'/> |
143 | <field name='displayFanSpeed' type='MFString' accessType='outputOnly'/> |
<![CDATA[
ecmascript: function switchPosition(pos) { if (switchPosition.pos.y == 0){ fanCycleTime = switchPosition.pos.y; displayFanSpeed[0] ='OFF'; } else{if (switchPosition.pos.y == 3){ fanCycleTime = .01; displayFanSpeed[0] ='MAX'; } else { fanCycleTime = (6 - (switchPosition.pos.y*2)); displayFanSpeed[0] = (Math.round((1/fanCycleTime)*6000)/100) + ' RPM'; }} }
]]>
|
|
145 | </Script> |
146 | <!-- Motor On/Off Buttons --> |
147 | <Transform translation='-1 1 1.6'> |
148 | <Transform rotation='1 0 0 1.571'> |
149 |
<!-- ROUTE information for OffButton node:
[from OffButtonDownPath.value_changed to set_translation
]
[from OffButtonUpPath.value_changed to set_translation
]
-->
<Transform DEF='OffButton' translation='0 .1 .3'> |
150 | <Group> |
151 | <Shape> |
152 | <Cylinder height='.45' radius='.2'/> |
153 | <Appearance DEF='RedStatus'> |
154 | <Material diffuseColor='1 0.3 0.3'/> |
155 | </Appearance> |
156 | </Shape> |
157 |
<!-- ROUTE information for SensorOffButton node:
[from touchTime to MotorClockOff.set_startTime
]
[from isActive to MotorButtonActionOff.offButtonAction
]
-->
<TouchSensor DEF='SensorOffButton'/> |
158 |
<!-- ROUTE information for OffButtonDownPath node:
[from MotorClockOff.fraction_changed to set_fraction
]
[from value_changed to OffButton.set_translation
]
-->
<PositionInterpolator DEF='OffButtonDownPath' key='0.0 0.50 1.0' keyValue='0.0 0.3 0.3 0.0 0.2 0.3 0.0 0.1 0.3'/> |
159 |
<!-- ROUTE information for OffButtonUpPath node:
[from MotorClockOn.fraction_changed to set_fraction
]
[from value_changed to OffButton.set_translation
]
-->
<PositionInterpolator DEF='OffButtonUpPath' key='0.0 0.50 1.0' keyValue='0.0 0.1 0.3 0.0 0.2 0.3 0.0 0.3 0.3'/> |
160 | </Group> |
161 | </Transform> |
162 |
<!-- ROUTE information for OnButton node:
[from OnButtonDownPath.value_changed to set_translation
]
[from OnButtonUpPath.value_changed to set_translation
]
-->
<Transform DEF='OnButton' translation='0 .3 -.3'> |
163 | <Group> |
164 | <Shape> |
165 | <Cylinder height='.45' radius='.2'/> |
166 | <Appearance DEF='GreenStatus'> |
167 | <Material diffuseColor='0.3 1 .3'/> |
168 | </Appearance> |
169 | </Shape> |
170 |
<!-- ROUTE information for SensorOnButton node:
[from touchTime to MotorClockOn.set_startTime
]
[from isActive to MotorButtonActionOn.onButtonAction
]
-->
<TouchSensor DEF='SensorOnButton'/> |
171 |
<!-- ROUTE information for OnButtonDownPath node:
[from MotorClockOn.fraction_changed to set_fraction
]
[from value_changed to OnButton.set_translation
]
-->
<PositionInterpolator DEF='OnButtonDownPath' key='0.0 0.50 1.0' keyValue='0.0 0.3 -0.3 0.0 0.2 -0.3 0.0 0.1 -0.3'/> |
172 |
<!-- ROUTE information for OnButtonUpPath node:
[from MotorClockOff.fraction_changed to set_fraction
]
[from value_changed to OnButton.set_translation
]
-->
<PositionInterpolator DEF='OnButtonUpPath' key='0.0 0.50 1.0' keyValue='0.0 0.1 -0.3 0.0 0.2 -0.3 0.0 0.3 -0.3'/> |
173 | </Group> |
174 | </Transform> |
175 |
<!-- ROUTE information for MotorClockOff node:
[from SensorOffButton.touchTime to set_startTime
]
[from fraction_changed to OffButtonDownPath.set_fraction
]
[from fraction_changed to OnButtonUpPath.set_fraction
]
[from fraction_changed to GtoRColorInerp.set_fraction
]
-->
<TimeSensor DEF='MotorClockOff'/> |
176 |
<!-- ROUTE information for MotorClockOn node:
[from SensorOnButton.touchTime to set_startTime
]
[from fraction_changed to OnButtonDownPath.set_fraction
]
[from fraction_changed to OffButtonUpPath.set_fraction
]
[from fraction_changed to RtoGColorInerp.set_fraction
]
-->
<TimeSensor DEF='MotorClockOn'/> |
177 | </Transform> |
178 | </Transform> |
179 | <!-- Motor Status Display --> |
180 | <Transform translation='.5 .8 1.83'> |
181 | <Group DEF='MotorStatus'> |
182 | <Transform translation='0 .5 .01'> |
183 | <Shape> |
184 | <Text string='"Motor Status:"'> |
185 | <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.5'/> |
186 | </Text> |
187 | <Appearance USE='BlackText'/> |
188 | </Shape> |
189 | </Transform> |
190 | <Transform translation='0 0 .01'> |
191 | <Shape> |
192 |
<!-- ROUTE information for StatusDisplay node:
[from MotorButtonActionOn.displayMotorStatus to set_string
]
[from MotorButtonActionOff.displayMotorStatus to set_string
]
-->
<Text DEF='StatusDisplay' string='"OFF"'> |
193 | <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.5'/> |
194 | </Text> |
195 | <Appearance> |
196 |
<!-- ROUTE information for MotorDisplayMaterial node:
[from RtoGColorInerp.value_changed to set_diffuseColor
]
[from GtoRColorInerp.value_changed to set_diffuseColor
]
-->
<Material DEF='MotorDisplayMaterial' diffuseColor='1 .3 .3'/> |
197 | </Appearance> |
198 | </Shape> |
199 | </Transform> |
200 | <Shape USE='DisplayField'/> |
201 | </Group> |
202 | </Transform> |
203 |
<!-- ROUTE information for MotorButtonActionOn node:
[from SensorOnButton.isActive to onButtonAction
]
[from displayMotorStatus to StatusDisplay.set_string
]
[from fanOnButtonAction to FanClock.set_cycleInterval
]
-->
<Script DEF='MotorButtonActionOn'> |
204 | <field name='onButtonAction' type='SFBool' accessType='inputOnly'/> |
205 | <field name='displayMotorStatus' type='MFString' accessType='outputOnly'/> |
206 | <field name='fanOnButtonAction' type='SFTime' accessType='outputOnly'/> |
<![CDATA[
ecmascript: function onButtonAction(bool) { if (onButtonAction.bool == true) { displayMotorStatus[0] ='ON'; fanOnButtonAction = 1; } }
]]>
|
|
208 | </Script> |
209 |
<!-- ROUTE information for MotorButtonActionOff node:
[from SensorOffButton.isActive to offButtonAction
]
[from displayMotorStatus to StatusDisplay.set_string
]
-->
<Script DEF='MotorButtonActionOff'> |
210 | <field name='offButtonAction' type='SFBool' accessType='inputOnly'/> |
211 | <field name='displayMotorStatus' type='MFString' accessType='outputOnly'/> |
<![CDATA[
ecmascript: function offButtonAction(bool) { if (offButtonAction.bool == true) { displayMotorStatus[0] ='OFF'; } }
]]>
|
|
213 | </Script> |
214 |
<!-- ROUTE information for RtoGColorInerp node:
[from MotorClockOn.fraction_changed to set_fraction
]
[from value_changed to MotorDisplayMaterial.set_diffuseColor
]
-->
<ColorInterpolator DEF='RtoGColorInerp' key='0 .1 .1 1' keyValue='1 .3 .3 1 .3 .3 .3 1 .3 .3 1 .3'/> |
215 |
<!-- ROUTE information for GtoRColorInerp node:
[from MotorClockOff.fraction_changed to set_fraction
]
[from value_changed to MotorDisplayMaterial.set_diffuseColor
]
-->
<ColorInterpolator DEF='GtoRColorInerp' key='0 .1 .1 1' keyValue='.3 1 .3 .3 1 .3 1 .3 .3 1 .3 .3'/> |
216 | </Group> |
217 | <Group DEF='RemoteControl'> |
218 | <Transform rotation='1 0 0 -1.571'> |
219 | <Transform scale='.2 .5 .5' translation='0 -20 0'> |
220 | <Group USE='ControlPanel'/> |
221 | <Transform translation='0 0 1.325'> |
222 | <Shape> |
223 | <Box size='3 3 1'/> |
224 | <Appearance USE='DarkBlueGreyMetal'/> |
225 | </Shape> |
226 | </Transform> |
227 | </Transform> |
228 | </Transform> |
229 | </Group> |
230 | <!-- Route for controling Switch movement --> |
231 | < ROUTE fromNode='SwitchPlaneSensor' fromField='translation_changed' toNode='SwitchTransform' toField='set_translation'/> |
232 | <!-- Routes for controling Fan w/ Switch --> |
233 | < ROUTE fromNode='SwitchPlaneSensor' fromField='translation_changed' toNode='MotorAmp' toField='switchPosition'/> |
234 | < ROUTE fromNode='MotorAmp' fromField='fanCycleTime' toNode='FanClock' toField='set_cycleInterval'/> |
235 | < ROUTE fromNode='FanClock' fromField='fraction_changed' toNode='FanPath' toField='set_fraction'/> |
236 | < ROUTE fromNode='FanPath' fromField='value_changed' toNode='Fan' toField='set_rotation'/> |
237 | <!-- Button Movement Routes --> |
238 | < ROUTE fromNode='SensorOffButton' fromField='touchTime' toNode='MotorClockOff' toField='set_startTime'/> |
239 | < ROUTE fromNode='SensorOffButton' fromField='isActive' toNode='MotorButtonActionOff' toField='offButtonAction'/> |
240 | < ROUTE fromNode='SensorOnButton' fromField='touchTime' toNode='MotorClockOn' toField='set_startTime'/> |
241 | < ROUTE fromNode='SensorOnButton' fromField='isActive' toNode='MotorButtonActionOn' toField='onButtonAction'/> |
242 | < ROUTE fromNode='MotorClockOn' fromField='fraction_changed' toNode='OnButtonDownPath' toField='set_fraction'/> |
243 | < ROUTE fromNode='MotorClockOn' fromField='fraction_changed' toNode='OffButtonUpPath' toField='set_fraction'/> |
244 | < ROUTE fromNode='MotorClockOff' fromField='fraction_changed' toNode='OffButtonDownPath' toField='set_fraction'/> |
245 | < ROUTE fromNode='MotorClockOff' fromField='fraction_changed' toNode='OnButtonUpPath' toField='set_fraction'/> |
246 | < ROUTE fromNode='OnButtonDownPath' fromField='value_changed' toNode='OnButton' toField='set_translation'/> |
247 | < ROUTE fromNode='OffButtonDownPath' fromField='value_changed' toNode='OffButton' toField='set_translation'/> |
248 | < ROUTE fromNode='OnButtonUpPath' fromField='value_changed' toNode='OnButton' toField='set_translation'/> |
249 | < ROUTE fromNode='OffButtonUpPath' fromField='value_changed' toNode='OffButton' toField='set_translation'/> |
250 | <!-- Route for Fan display --> |
251 | < ROUTE fromNode='MotorAmp' fromField='displayFanSpeed' toNode='SpeedDisplay' toField='set_string'/> |
252 | <!-- Route for Motor display --> |
253 | < ROUTE fromNode='MotorClockOn' fromField='fraction_changed' toNode='RtoGColorInerp' toField='set_fraction'/> |
254 | < ROUTE fromNode='MotorClockOff' fromField='fraction_changed' toNode='GtoRColorInerp' toField='set_fraction'/> |
255 | < ROUTE fromNode='MotorButtonActionOn' fromField='displayMotorStatus' toNode='StatusDisplay' toField='set_string'/> |
256 | < ROUTE fromNode='RtoGColorInerp' fromField='value_changed' toNode='MotorDisplayMaterial' toField='set_diffuseColor'/> |
257 | < ROUTE fromNode='GtoRColorInerp' fromField='value_changed' toNode='MotorDisplayMaterial' toField='set_diffuseColor'/> |
258 | < ROUTE fromNode='MotorButtonActionOff' fromField='displayMotorStatus' toNode='StatusDisplay' toField='set_string'/> |
259 | <!-- Buttons control Fan --> |
260 | < ROUTE fromNode='MotorButtonActionOn' fromField='fanOnButtonAction' toNode='FanClock' toField='set_cycleInterval'/> |
261 | <!-- --> |
262 | </Scene> |
263 | </X3D> |
Event Graph ROUTE Table entries with 25 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.
SensorOffButton
TouchSensor touchTime SFTime |
MotorClockOff
TimeSensor set_startTime SFTime |
then
|
MotorClockOff
TimeSensor fraction_changed SFFloat |
OffButtonDownPath
PositionInterpolator set_fraction SFFloat |
then
|
OffButtonDownPath
PositionInterpolator value_changed SFVec3f |
OffButton
Transform set_translation SFVec3f |
|||
then
|
MotorClockOff
TimeSensor fraction_changed SFFloat |
OnButtonUpPath
PositionInterpolator set_fraction SFFloat |
then
|
OnButtonUpPath
PositionInterpolator value_changed SFVec3f |
OnButton
Transform set_translation SFVec3f |
|||||
then
|
MotorClockOff
TimeSensor fraction_changed SFFloat |
GtoRColorInerp
ColorInterpolator set_fraction SFFloat |
then
|
GtoRColorInerp
ColorInterpolator value_changed SFColor |
MotorDisplayMaterial
Material set_diffuseColor SFColor |
|||||
SensorOffButton
TouchSensor isActive SFBool |
MotorButtonActionOff
Script offButtonAction SFBool |
then
|
MotorButtonActionOff
Script displayMotorStatus MFString |
StatusDisplay
Text set_string MFString |
SwitchPlaneSensor
PlaneSensor translation_changed SFVec3f |
SwitchTransform
Transform set_translation SFVec3f |
|||||||||||||
SwitchPlaneSensor
PlaneSensor translation_changed SFVec3f |
MotorAmp
Script switchPosition SFVec3f |
then
|
MotorAmp
Script displayFanSpeed MFString |
SpeedDisplay
Text set_string MFString |
||||||||||
then
|
MotorAmp
Script fanCycleTime SFTime |
FanClock
TimeSensor set_cycleInterval SFTime |
then
|
FanClock
TimeSensor fraction_changed SFFloat |
FanPath
OrientationInterpolator set_fraction SFFloat |
then
|
FanPath
OrientationInterpolator value_changed SFRotation |
Fan
Transform set_rotation SFRotation |
<!--
Color 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)
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->