X3D Model Documentation: IntegerSequencerRoadSignSwitcher.x3d

  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='titlecontent='IntegerSequencerRoadSignSwitcher.x3d'/>
  6            <meta name='descriptioncontent='Switch among different road signs using IntegerSequencer'/>
  7            <meta name='creatorcontent='Don Brutzman'/>
  8            <meta name='createdcontent='2 January 2009'/>
  9            <meta name='modifiedcontent='20 October 2019'/>
 10            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/IntegerSequencerRoadSignSwitcher.x3d'/>
 11            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 12            <meta name='licensecontent='../license.html'/>
 13       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: Frame, Sequencer, SignHolder, Switch, Time

Index for Viewpoint node: Viewpoint_1
-->
 14       <Scene>
 15            <WorldInfo title='IntegerSequencerRoadSignSwitcher.x3d'/>
 16            <Background groundColor='0.2 0.2 0.2skyColor='0.2 0.2 0.2'/>
 17            <Viewpoint description='Road sign switcher, 6m awayposition='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='0diffuseColor='0 0 0emissiveColor='1 0.442751 0shininess='0.05102specularColor='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='SwitchwhichChoice='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='SignHoldersize='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='Sequencerkey='0 0.25 0.5 0.75 1keyValue='0 1 2 3 0'/>
 58 
          <!-- ROUTE information for Time node:  [from fraction_changed to Sequencer.set_fraction ] -->
          <TimeSensor DEF='TimecycleInterval='8loop='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 shows event connections.
-->

<!-- to top Index for DEF nodes: Frame, Sequencer, SignHolder, Switch, Time

Index for Viewpoint node: Viewpoint_1
-->
X3D Tooltips element index: Appearance, Background, Box, head, ImageTexture, IntegerSequencer, Material, meta, ROUTE, Scene, Shape, Switch, TimeSensor, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

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

ROUTE
event to
(1)
Sequencer
IntegerSequencer
set_fraction
SFFloat
then
 
 
 
Sequencer
IntegerSequencer
value_changed
SFInt32

ROUTE
event to
(2)
Switch
Switch
whichChoice
SFInt32
Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/IntegerSequencerRoadSignSwitcherIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/IntegerSequencerRoadSignSwitcher.x3d -->

<!-- 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)
-->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->