X3D Model Documentation: TimeDelaySensorExample.x3d

  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='titlecontent='TimeDelaySensorExample.x3d'/>
  6            <meta name='descriptioncontent='Time delay sensor design pattern: example use.'/>
  7            <meta name='creatorcontent='Don Brutzman and MV4204 class'/>
  8            <meta name='createdcontent='18 August 2003'/>
  9            <meta name='modifiedcontent='28 November 2019'/>
 10            <meta name='referencecontent='TimeDelaySensorPrototype.x3d'/>
 11            <meta name='referencecontent='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/time.html'/>
 12            <meta name='referencecontent='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/utils.html'/>
 13            <meta name='subjectcontent='TimeDelaySensor'/>
 14            <meta name='identifiercontent='https://savage.nps.edu/Savage/Tools/Animation/TimeDelaySensorExample.x3d'/>
 15            <meta name='generatorcontent='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit'/>
 16            <meta name='licensecontent='../../license.html'/>
 17       </head>
<!--

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

<!-- to top Index for DEF nodes: AnimationClock, ColorChangerRGB, DelayTimer, TextAnimationGroup, TextColor, TextTouchGroup, TouchSensorActive

Index for ExternProtoDeclare definition: TimeDelaySensor
-->
 18       <Scene>
 19            <WorldInfo title='TimeDelaySensorExample.x3d'/>
 20            <ExternProtoDeclare name='TimeDelaySensorappinfo='TimeSensor functionality commences after delayInterval pause'   url=' "TimeDelaySensorPrototype.x3d#TimeDelaySensor" "https://savage.nps.edu/Savage/Tools/Animation/TimeDelaySensorPrototype.x3d#TimeDelaySensor" "TimeDelaySensorPrototype.wrl#TimeDelaySensor" "https://savage.nps.edu/Savage/Tools/Animation/TimeDelaySensorPrototype.wrl#TimeDelaySensor" '>
 21                 <field name='descriptiontype='SFStringaccessType='inputOutput'
                appinfo='describe the purpose of this sensor'/>
 22                 <field name='startTimetype='SFTimeaccessType='inputOutput'/>
 23                 <field name='enabledtype='SFBoolaccessType='inputOutput'/>
 24                 <field name='delayIntervaltype='SFTimeaccessType='inputOutput'
                appinfo='seconds'/>
 25                 <field name='delayCompleteTimetype='SFTimeaccessType='outputOnly'/>
 26                 <field name='traceEnabledtype='SFBoolaccessType='initializeOnly'/>
 27            </ExternProtoDeclare>
 28            <!-- ==================== -->
 29            <Group DEF='TextTouchGroup'>
 30                 <Shape>
 31                      <Text string='"click text then wait for" "3 second time delay" "before color changes"'>
 32                           <FontStyle justify='"MIDDLE" "MIDDLE"'/>
 33                      </Text>
 34                      <Appearance>
 35 
                         <!-- ROUTE information for TextColor node:  [from ColorChangerRGB.value_changed to diffuseColor ] -->
                         <Material DEF='TextColor'/>
 36                      </Appearance>
 37                 </Shape>
 38 
               <!-- ROUTE information for TouchSensorActive node:  [from touchTime to DelayTimer.set_startTime ] -->
               <TouchSensor DEF='TouchSensorActivedescription='click to initiate time delay and color change'/>
 39            </Group>
 40            <!-- ==================== -->
 41            <Group DEF='TextAnimationGroup'>
 42 
               <!-- ROUTE information for DelayTimer node:  [from TouchSensorActive.touchTime to set_startTime ] [from delayCompleteTime to AnimationClock.set_startTime ] -->
               <ProtoInstance name='TimeDelaySensorDEF='DelayTimer'>
 43                      <fieldValue name='delayIntervalvalue='3'/>
 44                      <fieldValue name='traceEnabledvalue='true'/>
 45                 </ProtoInstance>
 46 
               <!-- ROUTE information for AnimationClock node:  [from DelayTimer.delayCompleteTime to set_startTime ] [from fraction_changed to ColorChangerRGB.set_fraction ] -->
               <TimeSensor DEF='AnimationClockcycleInterval='2'/>
 47                 < ROUTE  fromNode='TouchSensorActive' fromField='touchTime' toNode='DelayTimer' toField='set_startTime'/>
 48                 < ROUTE  fromNode='DelayTimer' fromField='delayCompleteTime' toNode='AnimationClock' toField='set_startTime'/>
 49 
               <!-- ROUTE information for ColorChangerRGB node:  [from AnimationClock.fraction_changed to set_fraction ] [from value_changed to TextColor.diffuseColor ] -->
               <ColorInterpolator DEF='ColorChangerRGBkey='0 0.5 1keyValue='1 0 0 0 1 0 0 0 1'/>
 50                 < ROUTE  fromNode='AnimationClock' fromField='fraction_changed' toNode='ColorChangerRGB' toField='set_fraction'/>
 51                 < ROUTE  fromNode='ColorChangerRGB' fromField='value_changed' toNode='TextColor' toField='diffuseColor'/>
 52            </Group>
 53       </Scene>
 54  </X3D>
<!--

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

<!-- to top Index for DEF nodes: AnimationClock, ColorChangerRGB, DelayTimer, TextAnimationGroup, TextColor, TextTouchGroup, TouchSensorActive

Index for ExternProtoDeclare definition: TimeDelaySensor
-->
X3D Tooltips element index: Appearance, ColorInterpolator, ExternProtoDeclare, field, fieldValue, FontStyle, Group, head, Material, meta, ProtoInstance, ROUTE, Scene, Shape, Text, TimeSensor, TouchSensor, WorldInfo, X3D, accessType and type, XML data types, field types

Event Graph ROUTE Table entries with 4 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.

TouchSensorActive
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
DelayTimer
ProtoInstance
set_startTime
UnknownFieldType
then
 
 
 
DelayTimer
ProtoInstance
delayCompleteTime
SFTime

ROUTE
event to
(2)
AnimationClock
TimeSensor
set_startTime
SFTime
then
 
 
 
AnimationClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(3)
ColorChangerRGB
ColorInterpolator
set_fraction
SFFloat
then
 
 
 
ColorChangerRGB
ColorInterpolator
value_changed
SFColor

ROUTE
event to
(4)
TextColor
Material
diffuseColor
SFColor

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://savage.nps.edu/Savage/Tools/Animation/TimeDelaySensorExampleIndex.html -->
<!-- Version control at
https://gitlab.nps.edu/Savage/Savage/Tools/Animation/TimeDelaySensorExample.x3d -->

<!-- Color legend: X3D terminology <X3dNode  DEF='idNamefield='value'/> matches XML terminology <XmlElement  DEF='idNameattribute='value'/>
(Light-blue background: event-based behavior node or statement) (Grey background inside box: inserted documentation) (Magenta background: X3D Extensibility)
    <ProtoInstance name='ProtoName'> <field name='fieldName'/> ProtoInstance> -->

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