| 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=' FormulaOneRaceCar.x3d '/> |
| 6 | <meta name='description' content='A FormulaOne Race Car running in a predefined path'/> |
| 7 | <meta name='creator' content='Athanasopoulos,Vasileios'/> |
| 8 | <meta name='created' content='2 August 2002'/> |
| 9 | <meta name='modified' content='20 October 2019'/> |
| 10 | <meta name=' warning ' content=' Missing files: nplogo.jpg (npslogo.jpg?) front.jpg f1.wav f2.wav f3.wav ' /> |
| 11 | <meta name='subject' content='Formula One Race Car'/> |
| 12 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/FormulaOneRaceCar.x3d '/> |
| 13 | <meta name='generator' content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 14 | <meta name='license' content='../license.html'/> |
| 15 | </head> |
| 16 | <Scene> |
| 17 | <Viewpoint description='Formula One Race Car' orientation='-1 1 1 1' position='6 8 8'/> |
| 18 | <DirectionalLight direction='5 0 0'/> |
| 19 | <Viewpoint description='Bottom' orientation='1 0 0 1.57' position='0 -25 -8'/> |
| 20 | <Background groundColor='0 0 0' skyColor='0 0 1'/> |
| 21 |
<!-- ROUTE information for CAR node:
[from DRAG.translation_changed to set_translation
]
[from MOVE.value_changed to set_translation
]
-->
<Transform DEF='CAR' rotation='0 1 0 -1.57'> |
| 22 | <Group DEF='ViewpointGroup'> |
| 23 | <Group> |
| 24 | <Viewpoint description='Front' orientation='0 1 0 1.57' position='10 2 0'/> |
| 25 | <Viewpoint description='Right' position='0 2 10'/> |
| 26 | <Viewpoint description='Left' orientation='0 1 0 3.14' position='0 1.5 -14'/> |
| 27 | <Viewpoint description='Back' orientation='0 1 0 -1.57' position='-10 0.85 0'/> |
| 28 | <Viewpoint description='Top' orientation='1 0 0 -1.57' position='0 15 0.5'/> |
| 29 | </Group> |
| 30 | <WorldInfo info='"null node"'/> |
| 31 | </Group> |
| 32 | <Group> |
| 33 |
<!-- ROUTE information for FORMULA node:
[from TURN.value_changed to set_rotation
]
-->
<Transform DEF='FORMULA'> |
| 34 | <Transform rotation='1 0 0 -1.57'> |
| 35 | <!-- "BACK WHEELS & AXIS" --> |
| 36 | <Group> |
| 37 | <Transform rotation='1 0 0 1.57' translation='0 -2.8 0'> |
| 38 | <Group> |
| 39 |
<!-- ROUTE information for BACK node:
[from POS1.value_changed to set_rotation
]
-->
<Transform DEF='BACK'> |
| 40 | <Transform DEF='wheel1' rotation='0 0 1 1.57' translation='1.5 0 0'> |
| 41 | <!-- "OUTER WHEEL CYLINDER" --> |
| 42 | |
| 43 | <Appearance> |
| 44 | <Material diffuseColor='0 0 0'/> |
| 45 | </Appearance> |
| 46 | <Cylinder height='0.92' radius='0.65'/> |
| 47 | </Shape> |
| 48 | <!-- "INNER WHEEL CYLINDER" --> |
| 49 | <Shape> |
| 50 | <Appearance> |
| 51 | <Material diffuseColor='.5 .5 .5'/> |
| 52 | </Appearance> |
| 53 | <Cylinder height='.92' radius='.45'/> |
| 54 | </Shape> |
| 55 | </Transform> |
| 56 | <Transform translation='1.912 0 0'> |
| 57 | |
| 58 | <Appearance> |
| 59 | <Material/> |
| 60 | </Appearance> |
| 61 | <Box size='0.1 0.90 0.05'/> |
| 62 | </Shape> |
| 63 | </Transform> |
| 64 | <Transform rotation='1 0 0 1.57' translation='1.912 0 0'> |
| 65 | <Shape> |
| 66 | <Appearance> |
| 67 | <Material/> |
| 68 | </Appearance> |
| 69 | <Box size='0.1 0.90 0.05'/> |
| 70 | </Shape> |
| 71 | </Transform> |
| 72 | <Transform DEF='wheel2' rotation='0 0 1 1.57' translation='-1.5 0 0'> |
| 73 | <!-- "OUTER WHEEL CYLINDER" --> |
| 74 | <Shape USE='elastic'/> |
| 75 | <!-- "INNER WHEEL CYLINDER" --> |
| 76 | <Shape> |
| 77 | <Appearance> |
| 78 | <Material diffuseColor='.5 .5 .5'/> |
| 79 | </Appearance> |
| 80 | <Cylinder height='.92' radius='.45'/> |
| 81 | </Shape> |
| 82 | </Transform> |
| 83 | <Transform translation='-1.912 0 0'> |
| 84 | <Shape USE='rad'/> |
| 85 | </Transform> |
| 86 | <Transform rotation='1 0 0 1.57' translation='-1.912 0 0'> |
| 87 | <Shape> |
| 88 | <Appearance> |
| 89 | <Material/> |
| 90 | </Appearance> |
| 91 | <Box size='0.1 0.90 0.05'/> |
| 92 | </Shape> |
| 93 | </Transform> |
| 94 | <Transform DEF='axis1' rotation='0 0 1 1.57'> |
| 95 | <Shape> |
| 96 | <Appearance> |
| 97 | <Material diffuseColor='0 0 0'/> |
| 98 | </Appearance> |
| 99 | <Cylinder height='3.96' radius='.12'/> |
| 100 | </Shape> |
| 101 | </Transform> |
| 102 | </Transform> |
| 103 |
<!-- ROUTE information for CLOCK1 node:
[from fraction_changed to POS1.set_fraction
]
-->
<TimeSensor DEF='CLOCK1' cycleInterval='2' loop='true'/> |
| 104 |
<!-- ROUTE information for POS1 node:
[from CLOCK1.fraction_changed to set_fraction
]
[from value_changed to BACK.set_rotation
]
-->
<OrientationInterpolator DEF='POS1' key='0 0.5 1' keyValue='1 0 0 0 1 0 0 -3.14 1 0 0 -6.28'/> |
| 105 | </Group> |
| 106 | < ROUTE fromNode='CLOCK1' fromField='fraction_changed' toNode='POS1' toField='set_fraction'/> |
| 107 | < ROUTE fromNode='POS1' fromField='value_changed' toNode='BACK' toField='set_rotation'/> |
| 108 | </Transform> |
| 109 | </Group> |
| 110 | <!-- "FRONT WHEELS & AXIS" --> |
| 111 | <Group> |
| 112 | <Transform rotation='1 0 0 1.57' translation='0 2.65 0'> |
| 113 | <Group> |
| 114 |
<!-- ROUTE information for FRONT node:
[from POS2.value_changed to set_rotation
]
-->
<Transform DEF='FRONT'> |
| 115 | <Transform DEF='wheel3' rotation='0 0 1 1.57' translation='1.5 0 0'> |
| 116 | <!-- "OUTER WHEEL CYLINDER" --> |
| 117 | <Shape DEF='elastic1'> |
| 118 | <Appearance> |
| 119 | <Material diffuseColor='0 0 0'/> |
| 120 | </Appearance> |
| 121 | <Cylinder height='0.92' radius='0.65'/> |
| 122 | </Shape> |
| 123 | <!-- "INNER WHEEL CYLINDER" --> |
| 124 | <Shape> |
| 125 | <Appearance> |
| 126 | <Material diffuseColor='.5 .5 .5'/> |
| 127 | </Appearance> |
| 128 | <Cylinder height='.92' radius='.45'/> |
| 129 | </Shape> |
| 130 | </Transform> |
| 131 | <Transform translation='1.912 0 0'> |
| 132 | <Shape USE='rad'/> |
| 133 | </Transform> |
| 134 | <Transform rotation='1 0 0 1.57' translation='1.912 0 0'> |
| 135 | <Shape> |
| 136 | <Appearance> |
| 137 | <Material/> |
| 138 | </Appearance> |
| 139 | <Box size='0.1 .90 .05'/> |
| 140 | </Shape> |
| 141 | </Transform> |
| 142 | <Transform DEF='wheel4' rotation='0 0 1 1.57' translation='-1.5 0 0'> |
| 143 | <!-- "OUTER WHEEL CYLINDER" --> |
| 144 | <Shape USE='elastic'/> |
| 145 | <!-- "INNER WHEEL CYLINDER" --> |
| 146 | <Shape> |
| 147 | <Appearance> |
| 148 | <Material diffuseColor='.5 .5 .5'/> |
| 149 | </Appearance> |
| 150 | <Cylinder height='.92' radius='.45'/> |
| 151 | </Shape> |
| 152 | </Transform> |
| 153 | <Transform translation='-1.912 0 0'> |
| 154 | <Shape USE='rad'/> |
| 155 | </Transform> |
| 156 | <Transform rotation='1 0 0 1.57' translation='-1.912 0 0'> |
| 157 | <Shape> |
| 158 | <Appearance> |
| 159 | <Material/> |
| 160 | </Appearance> |
| 161 | <Box size='0.1 .90 .05'/> |
| 162 | </Shape> |
| 163 | </Transform> |
| 164 | <Transform DEF='axis2' rotation='0 0 1 1.57'> |
| 165 | <Shape> |
| 166 | <Appearance> |
| 167 | <Material diffuseColor='0 0 0'/> |
| 168 | </Appearance> |
| 169 | <Cylinder height='3.96' radius='.12'/> |
| 170 | </Shape> |
| 171 | </Transform> |
| 172 | </Transform> |
| 173 |
<!-- ROUTE information for CLOCK2 node:
[from fraction_changed to POS2.set_fraction
]
-->
<TimeSensor DEF='CLOCK2' cycleInterval='2' loop='true'/> |
| 174 |
<!-- ROUTE information for POS2 node:
[from CLOCK2.fraction_changed to set_fraction
]
[from value_changed to FRONT.set_rotation
]
-->
<OrientationInterpolator DEF='POS2' key='0 0.5 1' keyValue='1 0 0 0 1 0 0 -3.14 1 0 0 -6.28'/> |
| 175 | < ROUTE fromNode='CLOCK2' fromField='fraction_changed' toNode='POS2' toField='set_fraction'/> |
| 176 | < ROUTE fromNode='POS2' fromField='value_changed' toNode='FRONT' toField='set_rotation'/> |
| 177 | </Group> |
| 178 | </Transform> |
| 179 | </Group> |
| 180 | <!-- "CAR BODY" --> |
| 181 | <Group> |
| 182 | <!-- "CAR BODY" --> |
| 183 | <Transform scale='1 4 0.5'> |
| 184 | <Shape> |
| 185 | <Appearance> |
| 186 | <Material diffuseColor='1 0 0'/> |
| 187 | </Appearance> |
| 188 | <Sphere/> |
| 189 | </Shape> |
| 190 | <Transform rotation='1 0 0 0' translation='0 0.2 0.976'> |
| 191 | <Shape> |
| 192 | <Appearance> |
| 193 | <Material diffuseColor='0.2 1 0' transparency='.5'/> |
| 194 |
<!-- ImageTexture
nplogo is a DEF node that has 1 USE node: USE_1 --> <ImageTexture DEF='nplogo' url=' "nplogo.jpg
" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/nplogo.jpg
" '/>
|
| 195 | </Appearance> |
| 196 | <Box size='0.7 .2 .0000001'/> |
| 197 | </Shape> |
| 198 | </Transform> |
| 199 | </Transform> |
| 200 | <Group/> |
| 201 | <!-- "PILOT'S COVER SHELL" --> |
| 202 |
<!-- ROUTE information for COVER node:
[from COVERSENS.rotation_changed to set_rotation
]
-->
<Transform DEF='COVER' center='0 0 0.535' scale='.5 0.9 0.3' translation='0 -1 0'> |
| 203 | <Shape> |
| 204 | <Appearance> |
| 205 | <Material transparency='0.55'/> |
| 206 | </Appearance> |
| 207 | <Sphere radius='1.3'/> |
| 208 | </Shape> |
| 209 |
<!-- ROUTE information for COVERSENS node:
[from rotation_changed to COVER.set_rotation
]
-->
<CylinderSensor DEF='COVERSENS' description='touch to activate' diskAngle='0.262' maxAngle='3.57'/> |
| 210 | </Transform> |
| 211 | < ROUTE fromNode='COVERSENS' fromField='rotation_changed' toNode='COVER' toField='set_rotation'/> |
| 212 | <!-- "PILOT'S HEAD" --> |
| 213 | <Transform translation='0 -1.3 0.5'> |
| 214 | <Viewpoint description='Driver' orientation='1 0 0 1.350' position='0 0.25 -0.015'/> |
| 215 | <Transform rotation='1 0 0 1.67' translation='0 0.7 -0.2'> |
| 216 | <Shape> |
| 217 | <Appearance> |
| 218 | <Material diffuseColor='1 0 0' transparency='.5'/> |
| 219 |
<ImageTexture
url=' "front.jpg
" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/front.jpg
" '/>
|
| 220 | </Appearance> |
| 221 | <Box size='0.9 0.8 0.01'/> |
| 222 | </Shape> |
| 223 | </Transform> |
| 224 | <Transform rotation='1 0 0 1.67' translation='0 0.701 -0.2'> |
| 225 | <Shape> |
| 226 | <Appearance> |
| 227 | <Material diffuseColor='1 0 0'/> |
| 228 | </Appearance> |
| 229 | <Box size='0.9 0.8 0.01'/> |
| 230 | </Shape> |
| 231 | </Transform> |
| 232 | <Shape> |
| 233 | <Appearance> |
| 234 | <Material diffuseColor='1 0 0'/> |
| 235 | </Appearance> |
| 236 | <Sphere radius='0.25'/> |
| 237 | </Shape> |
| 238 | </Transform> |
| 239 | <!-- "FRONT-HORIZONTAL PANEL-TEXTURES " --> |
| 240 | <Transform translation='0 3.80 -0.3'> |
| 241 | <!-- "FRONT (HORIZONTAL) PANEL" --> |
| 242 | <Shape> |
| 243 | <Appearance> |
| 244 | <Material diffuseColor='1 0 0'/> |
| 245 | </Appearance> |
| 246 | <Box size='3.94 .6 .03'/> |
| 247 | </Shape> |
| 248 | <!-- "FRONT-RIGHT (OUTER)VERTICAL PANEL" --> |
| 249 | <Transform translation='0.35 -0.2 0.15'> |
| 250 | <Shape> |
| 251 | <Appearance> |
| 252 | <Material diffuseColor='0.2 1 0'/> |
| 253 | </Appearance> |
| 254 | <Box size='.03 0.16 0.28'/> |
| 255 | </Shape> |
| 256 | </Transform> |
| 257 | <!-- "FRONT-LEFT (OUTER)VERTICAL PANEL --> |
| 258 | <Transform translation='-0.35 -0.2 0.15'> |
| 259 | <Shape> |
| 260 | <Appearance> |
| 261 | <Material diffuseColor='0.2 1 0'/> |
| 262 | </Appearance> |
| 263 | <Box size='.03 0.16 0.28'/> |
| 264 | </Shape> |
| 265 | </Transform> |
| 266 | <!-- "BACK TEXT" --> |
| 267 | <Transform rotation='0 0 1 -3.14' translation='1.40 -7.20 1.05'> |
| 268 | <Transform rotation='1 0 0 0.266'> |
| 269 | <Shape> |
| 270 | <Appearance> |
| 271 | <Material diffuseColor='1 1 0'/> |
| 272 | </Appearance> |
| 273 | <Text string='"MV-4204"'> |
| 274 | <FontStyle size='.8' style='BOLD'/> |
| 275 | </Text> |
| 276 | </Shape> |
| 277 | </Transform> |
| 278 | </Transform> |
| 279 | <!-- "FRONT RIGHT TEXT" --> |
| 280 | <Transform rotation='0 0 1 -3.14' translation='2.2 0.2 0'> |
| 281 | <Transform translation='.5 .020 0.05'> |
| 282 | <Shape> |
| 283 | <Appearance> |
| 284 | <Material diffuseColor='1 1 0'/> |
| 285 | </Appearance> |
| 286 | <Text string='"VRML"'> |
| 287 | <FontStyle size='.4' style='BOLD'/> |
| 288 | </Text> |
| 289 | </Shape> |
| 290 | </Transform> |
| 291 | </Transform> |
| 292 | <!-- "FRONT LEFT TEXT" --> |
| 293 | <Transform rotation='0 0 1 3.14' translation='-2.1 0.2 0'> |
| 294 | <Transform translation='-1.5 0.01 0.05'> |
| 295 | <Shape> |
| 296 | <Appearance> |
| 297 | <Material diffuseColor='1 1 0'/> |
| 298 | </Appearance> |
| 299 | <Text string='"VRML"'> |
| 300 | <FontStyle size='.4' style='BOLD'/> |
| 301 | </Text> |
| 302 | </Shape> |
| 303 | </Transform> |
| 304 | </Transform> |
| 305 | <!-- "FRONT-RIGHT (INNER)VERTICAL PANEL --> |
| 306 | <Transform translation='1.95 0.01 0.05'> |
| 307 | <Shape> |
| 308 | <Appearance> |
| 309 | <Material diffuseColor='0.2 1 0'/> |
| 310 | </Appearance> |
| 311 | <Box size='0.03 .6 .1'/> |
| 312 | </Shape> |
| 313 | </Transform> |
| 314 | <!-- "FRONT-LEFT (INNER)VERTICAL PANEL --> |
| 315 | <Transform translation='-1.95 0.01 0.05'> |
| 316 | <Shape> |
| 317 | <Appearance> |
| 318 | <Material diffuseColor='0.2 1 0'/> |
| 319 | </Appearance> |
| 320 | <Box size='0.03 .6 .1'/> |
| 321 | </Shape> |
| 322 | </Transform> |
| 323 | </Transform> |
| 324 | <!-- "BACK (INCLINED) UPPER PANEL" --> |
| 325 | <Transform rotation='1 0 0 -0.2' translation='0 -3.57 0.75'> |
| 326 | <Shape> |
| 327 | <Appearance> |
| 328 | <Material diffuseColor='1 0 0'/> |
| 329 | </Appearance> |
| 330 | <Box size='3.94 0.8 0.04'/> |
| 331 | </Shape> |
| 332 | <Transform translation='1.95 0 0.1'> |
| 333 | <Shape> |
| 334 | <Appearance> |
| 335 | <Material diffuseColor='0.2 1 0'/> |
| 336 | </Appearance> |
| 337 | <Box size='0.04 0.8 0.2'/> |
| 338 | </Shape> |
| 339 | </Transform> |
| 340 | <Transform translation='-1.95 0 0.1'> |
| 341 | <Shape> |
| 342 | <Appearance> |
| 343 | <Material diffuseColor='0.2 1 0'/> |
| 344 | </Appearance> |
| 345 | <Box size='0.04 0.8 0.2'/> |
| 346 | </Shape> |
| 347 | </Transform> |
| 348 | </Transform> |
| 349 | <!-- "HORIZONTAL PART OF THE CAR" --> |
| 350 | <Transform rotation='0 0 1 1.57' scale='1 1 0.05' translation='0 -0.15 0'> |
| 351 | <Shape> |
| 352 | <Appearance> |
| 353 | <Material diffuseColor='.2 1 0'/> |
| 354 | <ImageTexture USE='nplogo'/> |
| 355 | </Appearance> |
| 356 | <Cylinder height='3.95' radius='1.9'/> |
| 357 | </Shape> |
| 358 | <!-- "RIGHT TEXT" --> |
| 359 | <Transform rotation='0 0 1 -3.14' translation='0.6 1.65 2'> |
| 360 | <Shape> |
| 361 | <Appearance> |
| 362 | <Material diffuseColor='1 1 0'/> |
| 363 | </Appearance> |
| 364 | <Text string='"NPS"'> |
| 365 | <FontStyle size='.8' style='BOLD'/> |
| 366 | </Text> |
| 367 | </Shape> |
| 368 | </Transform> |
| 369 | <!-- "LEFT TEXT" --> |
| 370 | <Transform rotation='0 0 1 -6.28' translation='-0.8 -1.65 2'> |
| 371 | <Shape> |
| 372 | <Appearance> |
| 373 | <Material diffuseColor='1 1 0'/> |
| 374 | </Appearance> |
| 375 | <Text string='"NPS"'> |
| 376 | <FontStyle size='.8' style='BOLD'/> |
| 377 | </Text> |
| 378 | </Shape> |
| 379 | </Transform> |
| 380 | </Transform> |
| 381 | <!-- "BACK-LEFT VERTICAL PANEL" --> |
| 382 | <Transform translation='-0.42 -3.4 0.35'> |
| 383 | <Shape> |
| 384 | <Appearance> |
| 385 | <Material diffuseColor='0.2 1 0'/> |
| 386 | </Appearance> |
| 387 | <Box size='.06 0.26 0.7'/> |
| 388 | </Shape> |
| 389 | </Transform> |
| 390 | <!-- "BACK-RIGHT VERTICAL PANEL" --> |
| 391 | <Transform translation='0.42 -3.4 0.35'> |
| 392 | <Shape> |
| 393 | <Appearance> |
| 394 | <Material diffuseColor='0.2 1 0'/> |
| 395 | </Appearance> |
| 396 | <Box size='.06 0.26 0.7'/> |
| 397 | </Shape> |
| 398 | </Transform> |
| 399 | <!-- "EXHAUST" --> |
| 400 | <Transform translation='0.2 -3.88 0'> |
| 401 | |
| 402 | <Appearance> |
| 403 | <Material diffuseColor='0 0 0'/> |
| 404 | </Appearance> |
| 405 | <Cylinder height='.25' radius='.05'/> |
| 406 | </Shape> |
| 407 | </Transform> |
| 408 | <!-- "EXHAUST" --> |
| 409 | <Transform translation='-0.2 -3.88 0'> |
| 410 | <Shape USE='exhaust'/> |
| 411 | </Transform> |
| 412 | </Group> |
| 413 | </Transform> |
| 414 | <Sound DEF='Engine1'> |
| 415 | <AudioClip DEF='SOUNDSOURCE1' description='V1' loop='true' url=' "f1.wav" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/f1.wav" '/> |
| 416 | </Sound> |
| 417 | <Sound DEF='Engine2'> |
| 418 | <AudioClip DEF='SOUNDSOURCE2' description='V2' loop='true' url=' "f2.wav" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/f2.wav" '/> |
| 419 | </Sound> |
| 420 | <Sound DEF='Engine3'> |
| 421 | <AudioClip DEF='SOUNDSOURCE3' description='V3' loop='true' url=' "f3.wav" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/f3.wav" '/> |
| 422 | </Sound> |
| 423 | </Transform> |
| 424 |
<!-- ROUTE information for MOVE node:
[from CLOCK.fraction_changed to set_fraction
]
[from value_changed to CAR.set_translation
]
-->
<Script DEF='MOVE'> |
| 425 | <field name='set_fraction' type='SFFloat' accessType='inputOnly'/> |
| 426 | <field name='value_changed' type='SFVec3f' accessType='outputOnly'/> |
| 427 | <field name='radius' type='SFFloat' value='10' accessType='initializeOnly'/> |
| 428 | <field name='turns' type='SFFloat' value='1' accessType='initializeOnly'/> |
<![CDATA[
ecmascript:
function set_fraction (fraction,eventTime)
{
value_changed[0]=radius*Math.sin(turns*fraction*6.28);
value_changed[1]=0;
value_changed[2]=radius*Math.cos(turns*fraction*6.28);
}
]]>
|
|
| 430 | </Script> |
| 431 |
<!-- ROUTE information for TURN node:
[from CLOCK.fraction_changed to set_fraction
]
[from value_changed to FORMULA.set_rotation
]
-->
<Script DEF='TURN'> |
| 432 | <field name='set_fraction' type='SFFloat' accessType='inputOnly'/> |
| 433 | <field name='value_changed' type='SFRotation' accessType='outputOnly'/> |
| 434 | <field name='radius' type='SFFloat' value='1' accessType='initializeOnly'/> |
| 435 | <field name='turns' type='SFFloat' value='1' accessType='initializeOnly'/> |
<![CDATA[
ecmascript:
function set_fraction (fraction,eventTime)
{
value_changed[0]=0;
value_changed[1]=1;
value_changed[2]=0;
value_changed[3]=fraction*6.28;
}
]]>
|
|
| 437 | </Script> |
| 438 |
<!-- ROUTE information for DRAG node:
[from translation_changed to CAR.set_translation
]
-->
<PlaneSensor DEF='DRAG' description='touch to activate'/> |
| 439 |
<!-- ROUTE information for CLOCK node:
[from fraction_changed to MOVE.set_fraction
]
[from fraction_changed to TURN.set_fraction
]
-->
<TimeSensor DEF='CLOCK' cycleInterval='8.0' loop='true'/> |
| 440 | </Group> |
| 441 | < ROUTE fromNode='DRAG' fromField='translation_changed' toNode='CAR' toField='set_translation'/> |
| 442 | < ROUTE fromNode='CLOCK' fromField='fraction_changed' toNode='MOVE' toField='set_fraction'/> |
| 443 | < ROUTE fromNode='MOVE' fromField='value_changed' toNode='CAR' toField='set_translation'/> |
| 444 | < ROUTE fromNode='CLOCK' fromField='fraction_changed' toNode='TURN' toField='set_fraction'/> |
| 445 | < ROUTE fromNode='TURN' fromField='value_changed' toNode='FORMULA' toField='set_rotation'/> |
| 446 | </Transform> |
| 447 | </Scene> |
| 448 | </X3D> |
Event Graph ROUTE Table entries with 10 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.
|
CLOCK
TimeSensor fraction_changed SFFloat |
MOVE
Script set_fraction SFFloat |
then
|
MOVE
Script value_changed SFVec3f |
CAR
Transform set_translation SFVec3f |
||
|
CLOCK
TimeSensor fraction_changed SFFloat |
TURN
Script set_fraction SFFloat |
then
|
TURN
Script value_changed SFRotation |
FORMULA
Transform set_rotation SFRotation |
|
CLOCK1
TimeSensor fraction_changed SFFloat |
POS1
OrientationInterpolator set_fraction SFFloat |
then
|
POS1
OrientationInterpolator value_changed SFRotation |
BACK
Transform set_rotation SFRotation |
|
CLOCK2
TimeSensor fraction_changed SFFloat |
POS2
OrientationInterpolator set_fraction SFFloat |
then
|
POS2
OrientationInterpolator value_changed SFRotation |
FRONT
Transform set_rotation SFRotation |
|
DRAG
PlaneSensor translation_changed SFVec3f |
CAR
Transform set_translation SFVec3f |
|
COVERSENS
CylinderSensor rotation_changed SFRotation |
COVER
Transform set_rotation SFRotation |
<!--
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)
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->