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='Interactive' 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='IntegerSequencerRoadSignSwitcher.x3d'/> |
6 | <meta name='description' content='Switch among different road signs using IntegerSequencer'/> |
7 | <meta name='creator' content='Don Brutzman'/> |
8 | <meta name='created' content='2 January 2009'/> |
9 | <meta name='modified' content='20 October 2019'/> |
10 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/IntegerSequencerRoadSignSwitcher.x3d'/> |
11 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
12 | <meta name='license' content='../license.html'/> |
13 | </head> |
14 | <Scene> |
15 | <WorldInfo title='IntegerSequencerRoadSignSwitcher.x3d'/> |
16 | <Background groundColor='0.2 0.2 0.2' skyColor='0.2 0.2 0.2'/> |
17 | <Viewpoint description='Road sign switcher, 6m away' position='0 0 6'/> |
18 | <Shape DEF='Frame'> |
19 | <!-- Box framee scaled to be wider, taller and thinner than Box holding image --> |
20 | <Box size='3.5 2.7 0.05'/> |
21 | <Appearance> |
22 | <Material ambientIntensity='0' diffuseColor='0 0 0' emissiveColor='1 0.442751 0' shininess='0.05102' specularColor='0.475676 0.475676 0.475676'> |
23 | <!-- Universal Media Library: Neon 13 --> |
24 | </Material> |
25 | </Appearance> |
26 | </Shape> |
27 | <!-- Modify the whichChoice value in this Switch to 0, 1, 2 or 3 to see the various versions of the model. Select whichChoice= -1 to show nothing. --> |
28 |
<!-- ROUTE information for Switch node:
[from Sequencer.value_changed to whichChoice
]
-->
<Switch DEF='Switch' whichChoice='0'> |
29 | <!-- whichChoice values are 0, 1, 2, 3 for these four children --> |
30 | <Shape> |
31 | <!-- Box size scaled to match aspect ratio of original images --> |
32 |
<!-- Box
SignHolder is a DEF node that has 3 USE nodes: USE_1, USE_2, USE_3 --> <Box DEF='SignHolder' size='3.072 2.304 0.1'/> |
33 | <Appearance> |
34 | <!-- each image size reduced from 1-1.5M down to 150-200KB using GIMP for faster downloading, quality still looks good --> |
35 | <ImageTexture url=' "RoadSignRoadWorkAhead.jpg " "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter07EventAnimationInterpolation/RoadSignRoadWorkAhead.jpg " '/> |
36 | </Appearance> |
37 | </Shape> |
38 | <Shape> |
39 | <Box USE='SignHolder'/> |
40 | <Appearance> |
41 | <ImageTexture url=' "RoadSignExpectDelays.jpg " "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter07EventAnimationInterpolation/RoadSignExpectDelays.jpg " '/> |
42 | </Appearance> |
43 | </Shape> |
44 | <Shape> |
45 | <Box USE='SignHolder'/> |
46 | <Appearance> |
47 | <ImageTexture url=' "RoadSignMondayThruFriday.jpg " "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter07EventAnimationInterpolation/RoadSignMondayThruFriday.jpg " '/> |
48 | </Appearance> |
49 | </Shape> |
50 | <Shape> |
51 | <Box USE='SignHolder'/> |
52 | <Appearance> |
53 | <ImageTexture url=' "RoadSign7amTo5pm.jpg " "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter07EventAnimationInterpolation/RoadSign7amTo5pm.jpg " '/> |
54 | </Appearance> |
55 | </Shape> |
56 | </Switch> |
57 |
<!-- ROUTE information for Sequencer node:
[from Time.fraction_changed to set_fraction
]
[from value_changed to Switch.whichChoice
]
-->
<IntegerSequencer DEF='Sequencer' key='0 0.25 0.5 0.75 1' keyValue='0 1 2 3 0'/> |
58 |
<!-- ROUTE information for Time node:
[from fraction_changed to Sequencer.set_fraction
]
-->
<TimeSensor DEF='Time' cycleInterval='8' loop='true'/> |
59 | < ROUTE fromNode='Sequencer' fromField='value_changed' toNode='Switch' toField='whichChoice'/> |
60 | < ROUTE fromNode='Time' fromField='fraction_changed' toNode='Sequencer' toField='set_fraction'/> |
61 | </Scene> |
62 | </X3D> |
Event Graph ROUTE Table with 2 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.
Time
TimeSensor fraction_changed SFFloat |
Sequencer
IntegerSequencer set_fraction SFFloat |
then
|
Sequencer
IntegerSequencer value_changed SFInt32 |
Switch
Switch whichChoice SFInt32 |
<!--
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. -->