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='titlecontent=' TimeSensorEaseInEaseOutPrototype.x3d '/>
  6            <meta name='descriptioncontent='Time sensor ease-in ease-out design pattern, implemented as a reusable prototype node.'/>
  7            <meta name='creatorcontent='Don Brutzman and MV4204 class'/>
  8            <meta name='createdcontent='4 April 2006'/>
  9            <meta name='modifiedcontent='28 November 2019'/>
 10            <meta name='referencecontent=' TimeSensorEaseInEaseOutExample.x3d '/>
 11            <meta name='referencecontent=' TimeDelaySensorPrototype.x3d '/>
 12            <meta name='subjectcontent='TimeSensorEaseInEaseOut'/>
 13            <meta name='infocontent='X3D v3.1 or greater'/>
 14            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/TimeSensorEaseInEaseOutPrototype.x3d '/>
 15            <meta name='generatorcontent='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 16            <meta name='licensecontent='../../license.html'/>
 17       </head>
<!--

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

Index for ProtoDeclare definition: TimeSensorEaseInEaseOut
-->
 18       <Scene>
 19            <WorldInfo title='TimeSensorEaseInEaseOutPrototype.x3d'/>
 20            <ProtoDeclare name='TimeSensorEaseInEaseOutappinfo='TimeSensorEaseInEaseOut is a TimeSensor node with gradual start and stop rates'>
 21                 <ProtoInterface>
 22                      <field name='enabledtype='SFBoolvalue='trueaccessType='inputOutput'
                     appinfo='whether sensor is active'/>
 23                      <field name='looptype='SFBoolvalue='falseaccessType='inputOutput'
                     appinfo='repeat indefinitely when loop=true, repeat only once when loop=false'/>
 24                      <field name='cycleIntervaltype='SFTimevalue='1accessType='inputOutput'
                     appinfo='loop duration in seconds'/>
 25                      <field name='fraction_changedtype='SFFloataccessType='outputOnly'
                     appinfo='fraction_changed sends values in range [0,1] showing time progress in the current cycle'/>
 26                      <field name='isActivetype='SFBoolaccessType='outputOnly'
                     appinfo='isActive true/false events are sent when TimeSensor starts/stops running'/>
 27                      <field name='isPausedtype='SFBoolaccessType='outputOnly'
                     appinfo='isPaused true/false events are sent when TimeSensor is paused/resumed'/>
 28                      <field name='startTimetype='SFTimevalue='0accessType='inputOutput'
                     appinfo='when current time exceeds startTime, isActive becomes true and sensor becomes active'/>
 29                      <field name='stopTimetype='SFTimevalue='0accessType='inputOutput'
                     appinfo='when current time exceeds stopTime, isActive becomes false and sensor becomes inactive'/>
 30                      <field name='pauseTimetype='SFTimevalue='0accessType='inputOutput'
                     appinfo='when current time exceeds pauseTime, isPaused becomes false and sensor becomes paused'/>
 31                      <field name='resumeTimetype='SFTimevalue='0accessType='inputOutput'
                     appinfo='when current time exceeds resumeTime, isPaused becomes false and sensor resumes running'/>
 32                      <field name='cycleTimetype='SFTimeaccessType='outputOnly'
                     appinfo='cycleTime sends a time event at startTime, and also at the beginning of each new cycle'/>
 33                      <field name='elapsedTimetype='SFTimeaccessType='outputOnly'
                     appinfo='elapsed time since TimeSensor activated/running, cumulative in seconds, not counting any paused time'/>
 34                      <field name='timetype='SFTimeaccessType='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='enabledprotoField='enabled'/>
 41                                     <connect nodeField='loopprotoField='loop'/>
 42                                     <connect nodeField='cycleIntervalprotoField='cycleInterval'/>
 43                                     <!-- fraction_changed is handled by ScalarInterpolator -->
 44                                     <connect nodeField='isActiveprotoField='isActive'/>
 45                                     <connect nodeField='isPausedprotoField='isPaused'/>
 46                                     <connect nodeField='startTimeprotoField='startTime'/>
 47                                     <connect nodeField='stopTimeprotoField='stopTime'/>
 48                                     <connect nodeField='pauseTimeprotoField='pauseTime'/>
 49                                     <connect nodeField='resumeTimeprotoField='resumeTime'/>
 50                                     <connect nodeField='cycleTimeprotoField='cycleTime'/>
 51                                     <connect nodeField='elapsedTimeprotoField='elapsedTime'/>
 52                                     <connect nodeField='timeprotoField='time'/>
 53                                </IS>
 54                           </TimeSensor>
 55 
                         <!-- ROUTE information for PiecewiseLinearDelayFilter node:  [from TimeDelayClock.fraction_changed to set_fraction ] -->
                         <ScalarInterpolator DEF='PiecewiseLinearDelayFilterkey='0 0.1 0.9 1keyValue='0 0.03 0.97 1'>
 56                                <IS>
 57                                     <connect nodeField='value_changedprotoField='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://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/TimeSensorEaseInEaseOutExample.x3d" "TimeSensorEaseInEaseOutExample.wrl" "https://www.web3d.org/x3d/content/examples/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 DEF nodes index: 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://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/TimeSensorEaseInEaseOutPrototypeIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/Tools/Animation/TimeSensorEaseInEaseOutPrototype.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)
    <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. -->