X3D Model Documentation: TimeSensorEaseInEaseOutPrototype.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='title' content='TimeSensorEaseInEaseOutPrototype.x3d'/>
  6            <meta name='description' content='Time sensor ease-in ease-out design pattern, implemented as a reusable prototype node.'/>
  7            <meta name='creator' content='Don Brutzman and MV4204 class'/>
  8            <meta name='created' content='4 April 2006'/>
  9            <meta name='modified' content='28 November 2019'/>
 10            <meta name='reference' content='TimeSensorEaseInEaseOutExample.x3d'/>
 11            <meta name='reference' content='TimeDelaySensorPrototype.x3d'/>
 12            <meta name='subject' content='TimeSensorEaseInEaseOut'/>
 13            <meta name='info' content='X3D v3.1 or greater'/>
 14            <meta name='identifier' content='https://savage.nps.edu/Savage/Tools/Animation/TimeSensorEaseInEaseOutPrototype.x3d'/>
 15            <meta name='generator' content='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit'/>
 16            <meta name='license' content='../../license.html'/>
 17       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: PiecewiseLinearDelayFilter, TimeDelayClock

Index for ProtoDeclare definition: TimeSensorEaseInEaseOut
-->
 18       <Scene>
 19            <WorldInfo title='TimeSensorEaseInEaseOutPrototype.x3d'/>
 20            <ProtoDeclare name='TimeSensorEaseInEaseOut' appinfo='TimeSensorEaseInEaseOut is a TimeSensor node with gradual start and stop rates'>
 21                 <ProtoInterface>
 22                      <field name='enabled' type='SFBool' value='true' accessType='inputOutput'
                     appinfo='whether sensor is active'/>
 23                      <field name='loop' type='SFBool' value='false' accessType='inputOutput'
                     appinfo='repeat indefinitely when loop=true, repeat only once when loop=false'/>
 24                      <field name='cycleInterval' type='SFTime' value='1' accessType='inputOutput'
                     appinfo='loop duration in seconds'/>
 25                      <field name='fraction_changed' type='SFFloat' accessType='outputOnly'
                     appinfo='fraction_changed sends values in range [0,1] showing time progress in the current cycle'/>
 26                      <field name='isActive' type='SFBool' accessType='outputOnly'
                     appinfo='isActive true/false events are sent when TimeSensor starts/stops running'/>
 27                      <field name='isPaused' type='SFBool' accessType='outputOnly'
                     appinfo='isPaused true/false events are sent when TimeSensor is paused/resumed'/>
 28                      <field name='startTime' type='SFTime' value='0' accessType='inputOutput'
                     appinfo='when current time exceeds startTime, isActive becomes true and sensor becomes active'/>
 29                      <field name='stopTime' type='SFTime' value='0' accessType='inputOutput'
                     appinfo='when current time exceeds stopTime, isActive becomes false and sensor becomes inactive'/>
 30                      <field name='pauseTime' type='SFTime' value='0' accessType='inputOutput'
                     appinfo='when current time exceeds pauseTime, isPaused becomes false and sensor becomes paused'/>
 31                      <field name='resumeTime' type='SFTime' value='0' accessType='inputOutput'
                     appinfo='when current time exceeds resumeTime, isPaused becomes false and sensor resumes running'/>
 32                      <field name='cycleTime' type='SFTime' accessType='outputOnly'
                     appinfo='cycleTime sends a time event at startTime, and also at the beginning of each new cycle'/>
 33                      <field name='elapsedTime' type='SFTime' accessType='outputOnly'
                     appinfo='elapsed time since TimeSensor activated/running, cumulative in seconds, not counting any paused time'/>
 34                      <field name='time' type='SFTime' accessType='outputOnly'
                     appinfo='absolute time (since January 1, 1970) for each event loop'/>
 35                 </ProtoInterface>
 36                 <ProtoBody>
 37                      <Group>
 38 
                         <!-- ROUTE information for TimeDelayClock node:  [from fraction_changed to PiecewiseLinearDelayFilter.set_fraction ] -->
                         <TimeSensor DEF='TimeDelayClock'>
 39                                <IS>
 40                                     <connect nodeField='enabled' protoField='enabled'/>
 41                                     <connect nodeField='loop' protoField='loop'/>
 42                                     <connect nodeField='cycleInterval' protoField='cycleInterval'/>
 43                                     <!-- fraction_changed is handled by ScalarInterpolator -->
 44                                     <connect nodeField='isActive' protoField='isActive'/>
 45                                     <connect nodeField='isPaused' protoField='isPaused'/>
 46                                     <connect nodeField='startTime' protoField='startTime'/>
 47                                     <connect nodeField='stopTime' protoField='stopTime'/>
 48                                     <connect nodeField='pauseTime' protoField='pauseTime'/>
 49                                     <connect nodeField='resumeTime' protoField='resumeTime'/>
 50                                     <connect nodeField='cycleTime' protoField='cycleTime'/>
 51                                     <connect nodeField='elapsedTime' protoField='elapsedTime'/>
 52                                     <connect nodeField='time' protoField='time'/>
 53                                </IS>
 54                           </TimeSensor>
 55 
                         <!-- ROUTE information for PiecewiseLinearDelayFilter node:  [from TimeDelayClock.fraction_changed to set_fraction ] -->
                         <ScalarInterpolator DEF='PiecewiseLinearDelayFilter' key='0 0.1 0.9 1' keyValue='0 0.03 0.97 1'>
 56                                <IS>
 57                                     <connect nodeField='value_changed' protoField='fraction_changed'/>
 58                                </IS>
 59                           </ScalarInterpolator>
 60                           < ROUTE  fromNode='TimeDelayClock' fromField='fraction_changed' toNode='PiecewiseLinearDelayFilter' toField='set_fraction'/>
 61                      </Group>
 62                 </ProtoBody>
 63            </ProtoDeclare>
 64            <!-- ====================================== -->
 65            <!-- Example use -->
 66            <Anchor description='TimeSensorEaseInEaseOut Example'   url=' "TimeSensorEaseInEaseOutExample.x3d" "https://savage.nps.edu/Savage/Tools/Animation/TimeSensorEaseInEaseOutExample.x3d" "TimeSensorEaseInEaseOutExample.wrl" "https://savage.nps.edu/Savage/Tools/Animation/TimeSensorEaseInEaseOutExample.wrl" '>
 67                 <Shape>
 68                      <Text string='"TimeSensorEaseInEaseOutPrototype" "defines a prototype" "" "Click text to see" "TimeSensorEaseInEaseOutExample scene"'>
 69                           <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.7'/>
 70                      </Text>
 71                      <Appearance>
 72                           <Material diffuseColor='1 1 0.2'/>
 73                      </Appearance>
 74                 </Shape>
 75            </Anchor>
 76       </Scene>
 77  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: PiecewiseLinearDelayFilter, TimeDelayClock

Index for ProtoDeclare definition: TimeSensorEaseInEaseOut
-->
X3D Tooltips element index: Anchor, Appearance, connect, field, FontStyle, Group, head, IS, Material, meta, ProtoBody, ProtoDeclare, ProtoInterface, ROUTE, ScalarInterpolator, Scene, Shape, Text, TimeSensor, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

Event Graph ROUTE Table with 1 ROUTE connection 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.

TimeDelayClock
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(1)
PiecewiseLinearDelayFilter
ScalarInterpolator
set_fraction
SFFloat

line 66
Anchor
description='TimeSensorEaseInEaseOut Example' 
User-interaction hint for this node. 

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

<!-- 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)
    <ProtoDeclare name='ProtoName'> <field name='fieldName'/> </ProtoDeclare> -->

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