X3D Model Documentation: TimeSensorEaseInEaseOutExample.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2  <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.2//EN" "https://www.web3d.org/specifications/x3d-3.2.dtd">
  3  <X3D profile='Immersive' version='3.2 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.2.xsd'>
  4       <head>
  5            <meta name='titlecontent=' TimeSensorEaseInEaseOutExample.x3d '/>
  6            <meta name='descriptioncontent='Time sensor ease-in ease-out design pattern: example use.'/>
  7            <meta name='creatorcontent='Don Brutzman and MV4205 class'/>
  8            <meta name='createdcontent='4 April 2006'/>
  9            <meta name='modifiedcontent='28 November 2019'/>
 10            <meta name='referencecontent=' TimeSensorEaseInEaseOutPrototype.x3d '/>
 11            <meta name='referencecontent=' TimeDelaySensorExample.x3d '/>
 12            <meta name='referencecontent='TimeSensorEaseInEaseOut.png'/>
 13            <meta name='subjectcontent='TimeDelaySensor'/>
 14            <meta name='infocontent='X3D v3.1 or greater'/>
 15            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/TimeSensorEaseInEaseOutExample.x3d '/>
 16            <meta name='generatorcontent='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 17            <meta name='licensecontent='../../license.html'/>
 18       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: EasyClock, LinearClock, MoveEasy, MoveLinear, TextAnimationEasedGroup, TextAnimationLinearGroup, TextColor, TextTouchGroup, TouchSensorActive, TransformBoxEasy, TransformBoxLinear

Index for ExternProtoDeclare definition: TimeSensorEaseInEaseOut
-->
 19       <Scene>
 20            <WorldInfo title='TimeSensorEaseInEaseOutExample.x3d'/>
 21            <ExternProtoDeclare name='TimeSensorEaseInEaseOutappinfo='TimeSensorEaseInEaseOut is a TimeSensor node with gradual start and stop rates'   url=' "TimeSensorEaseInEaseOutPrototype.x3d#TimeSensorEaseInEaseOut" "../../../Savage/Tools/Animation/TimeSensorEaseInEaseOutPrototype.x3d#TimeSensorEaseInEaseOut" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/TimeSensorEaseInEaseOutPrototype.x3d#TimeSensorEaseInEaseOut" "TimeSensorEaseInEaseOutPrototype.wrl#TimeSensorEaseInEaseOut" "../../../Savage/Tools/Animation/TimeSensorEaseInEaseOutPrototype.wrl#TimeSensorEaseInEaseOut" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/TimeSensorEaseInEaseOutPrototype.wrl#TimeSensorEaseInEaseOut" '>
 22                 <field name='enabledtype='SFBoolaccessType='inputOutput'
                appinfo='whether sensor is active'/>
 23                 <field name='cycleIntervaltype='SFTimeaccessType='inputOutput'
                appinfo='loop duration in seconds'/>
 24                 <field name='fraction_changedtype='SFFloataccessType='outputOnly'
                appinfo='fraction_changed sends values in range [0,1] showing time progress in the current cycle'/>
 25                 <field name='looptype='SFBoolaccessType='inputOutput'
                appinfo='repeat indefinitely when loop=true, repeat only once when loop=false'/>
 26                 <field name='isActivetype='SFBoolaccessType='outputOnly'
                appinfo='isActive true/false events are sent when TimeSensor starts/stops running'/>
 27                 <field name='startTimetype='SFTimeaccessType='inputOutput'
                appinfo='when current time exceeds startTime, isActive becomes true and sensor becomes active'/>
 28                 <field name='stopTimetype='SFTimeaccessType='inputOutput'
                appinfo='when current time exceeds stopTime, isActive becomes false and sensor becomes inactive'/>
 29                 <field name='cycleTimetype='SFTimeaccessType='outputOnly'
                appinfo='cycleTime sends a time event at startTime, and also at the beginning of each new cycle'/>
 30                 <field name='timetype='SFTimeaccessType='outputOnly'
                appinfo='absolute time (since January 1, 1970) for each event loop'/>
 31                 <field name='pauseTimetype='SFTimeaccessType='inputOutput'
                appinfo='when current time exceeds pauseTime, isPaused becomes false and sensor becomes paused'/>
 32                 <field name='isPausedtype='SFBoolaccessType='outputOnly'
                appinfo='isPaused true/false events are sent when TimeSensor is paused/resumed'/>
 33                 <field name='elapsedTimetype='SFTimeaccessType='outputOnly'
                appinfo='elapsed time since TimeSensor activated/running, cumulative in seconds, not counting any paused time'/>
 34                 <field name='resumeTimetype='SFTimeaccessType='inputOutput'
                appinfo='when current time exceeds resumeTime, isPaused becomes false and sensor resumes running'/>
 35            </ExternProtoDeclare>
 36            <!-- ==================== -->
 37 
          <!-- ROUTE information for TransformBoxLinear node:  [from MoveLinear.value_changed to set_translation ] -->
          <Transform DEF='TransformBoxLineartranslation='-3 2 0'>
 38                 <Shape>
 39                      <Box/>
 40                      <Appearance>
 41                           <Material/>
 42                      </Appearance>
 43                 </Shape>
 44            </Transform>
 45 
          <!-- ROUTE information for TransformBoxEasy node:  [from MoveEasy.value_changed to set_translation ] -->
          <Transform DEF='TransformBoxEasytranslation='-3 1 0'>
 46                 <Shape>
 47                      <Box/>
 48                      <Appearance>
 49                           <Material diffuseColor='0.9 0.3 0.2'/>
 50                      </Appearance>
 51                 </Shape>
 52            </Transform>
 53            <Transform translation='0 -2 0'>
 54                 <Group DEF='TextTouchGroup'>
 55                      <Shape>
 56                           <Text string='"click text to move Boxes:" "linear TimeSensor grey" "EaseInEaseOut red"'>
 57                                <FontStyle justify='"MIDDLE" "MIDDLE"'/>
 58                           </Text>
 59                           <Appearance>
 60                                <Material DEF='TextColordiffuseColor='0 0.7 0.7'/>
 61                           </Appearance>
 62                      </Shape>
 63 
                    <!-- ROUTE information for TouchSensorActive node:  [from touchTime to LinearClock.set_startTime ] [from touchTime to EasyClock.startTime ] -->
                    <TouchSensor DEF='TouchSensorActivedescription='click to initiate time delay and color change'/>
 64                 </Group>
 65            </Transform>
 66            <!-- ==================== -->
 67            <Group DEF='TextAnimationLinearGroup'>
 68 
               <!-- ROUTE information for LinearClock node:  [from TouchSensorActive.touchTime to set_startTime ] [from fraction_changed to MoveLinear.set_fraction ] -->
               <TimeSensor DEF='LinearClockcycleInterval='3'/>
 69                 < ROUTE  fromNode='TouchSensorActive' fromField='touchTime' toNode='LinearClock' toField='set_startTime'/>
 70 
               <!-- ROUTE information for MoveLinear node:  [from LinearClock.fraction_changed to set_fraction ] [from value_changed to TransformBoxLinear.set_translation ] -->
               <PositionInterpolator DEF='MoveLinearkey='0 1keyValue='-3 2 0 3 2 0'/>
 71                 < ROUTE  fromNode='LinearClock' fromField='fraction_changed' toNode='MoveLinear' toField='set_fraction'/>
 72                 < ROUTE  fromNode='MoveLinear' fromField='value_changed' toNode='TransformBoxLinear' toField='set_translation'/>
 73            </Group>
 74            <Group DEF='TextAnimationEasedGroup'>
 75 
               <!-- ROUTE information for EasyClock node:  [from TouchSensorActive.touchTime to startTime ] [from fraction_changed to MoveEasy.set_fraction ] -->
               <ProtoInstance name='TimeSensorEaseInEaseOutDEF='EasyClock'>
 76                      <fieldValue name='cycleIntervalvalue='3'/>
 77                 </ProtoInstance>
 78                 < ROUTE  fromNode='TouchSensorActive' fromField='touchTime' toNode='EasyClock' toField='startTime'/>
 79 
               <!-- ROUTE information for MoveEasy node:  [from EasyClock.fraction_changed to set_fraction ] [from value_changed to TransformBoxEasy.set_translation ] -->
               <PositionInterpolator DEF='MoveEasykey='0 1keyValue='-3 1 0 3 1 0'/>
 80                 < ROUTE  fromNode='EasyClock' fromField='fraction_changed' toNode='MoveEasy' toField='set_fraction'/>
 81                 < ROUTE  fromNode='MoveEasy' fromField='value_changed' toNode='TransformBoxEasy' toField='set_translation'/>
 82            </Group>
 83       </Scene>
 84  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: EasyClock, LinearClock, MoveEasy, MoveLinear, TextAnimationEasedGroup, TextAnimationLinearGroup, TextColor, TextTouchGroup, TouchSensorActive, TransformBoxEasy, TransformBoxLinear

Index for ExternProtoDeclare definition: TimeSensorEaseInEaseOut
-->
X3D Tooltips element index: Appearance, Box, ExternProtoDeclare, field, fieldValue, FontStyle, Group, head, Material, meta, PositionInterpolator, ProtoInstance, ROUTE, Scene, Shape, Text, TimeSensor, TouchSensor, Transform, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

Event Graph ROUTE Table entries with 6 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)
LinearClock
TimeSensor
set_startTime
SFTime
then
 
 
 
LinearClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
MoveLinear
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
MoveLinear
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(3)
TransformBoxLinear
Transform
set_translation
SFVec3f
TouchSensorActive
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
EasyClock
ProtoInstance
startTime
SFTime
then
 
 
 
EasyClock
ProtoInstance
fraction_changed
SFFloat

ROUTE
event to
(2)
MoveEasy
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
MoveEasy
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(3)
TransformBoxEasy
Transform
set_translation
SFVec3f

      EasyClock
ProtoInstance
fraction_changed
SFFloat

ROUTE
event to
(1)
MoveEasy
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
MoveEasy
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(2)
TransformBoxEasy
Transform
set_translation
SFVec3f

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/Savage/Tools/Animation/TimeSensorEaseInEaseOutExampleIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/Tools/Animation/TimeSensorEaseInEaseOutExample.x3d -->

<!-- Color-coding 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. -->