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=' TimeSensorEaseInEaseOutExample.x3d '/> |
6 | <meta name='description' content='Time sensor ease-in ease-out design pattern: example use.'/> |
7 | <meta name='creator' content='Don Brutzman and MV4205 class'/> |
8 | <meta name='created' content='4 April 2006'/> |
9 | <meta name='modified' content='28 November 2019'/> |
10 | <meta name='reference' content=' TimeSensorEaseInEaseOutPrototype.x3d '/> |
11 | <meta name='reference' content=' TimeDelaySensorExample.x3d '/> |
12 |
<meta name='reference' content='TimeSensorEaseInEaseOut.png'![]() |
13 | <meta name='subject' content='TimeDelaySensor'/> |
14 | <meta name='info' content='X3D v3.1 or greater'/> |
15 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/TimeSensorEaseInEaseOutExample.x3d '/> |
16 | <meta name='generator' content='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
17 | <meta name='license' content='../../license.html'/> |
18 | </head> |
19 | <Scene> |
20 | <WorldInfo title='TimeSensorEaseInEaseOutExample.x3d'/> |
21 | <ExternProtoDeclare name='TimeSensorEaseInEaseOut' appinfo='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='enabled' type='SFBool' accessType='inputOutput'
appinfo='whether sensor is active'/> |
23 |
<field name='cycleInterval' type='SFTime' accessType='inputOutput'
appinfo='loop duration in seconds'/> |
24 |
<field name='fraction_changed' type='SFFloat' accessType='outputOnly'
appinfo='fraction_changed sends values in range [0,1] showing time progress in the current cycle'/> |
25 |
<field name='loop' type='SFBool' accessType='inputOutput'
appinfo='repeat indefinitely when loop=true, repeat only once when loop=false'/> |
26 |
<field name='isActive' type='SFBool' accessType='outputOnly'
appinfo='isActive true/false events are sent when TimeSensor starts/stops running'/> |
27 |
<field name='startTime' type='SFTime' accessType='inputOutput'
appinfo='when current time exceeds startTime, isActive becomes true and sensor becomes active'/> |
28 |
<field name='stopTime' type='SFTime' accessType='inputOutput'
appinfo='when current time exceeds stopTime, isActive becomes false and sensor becomes inactive'/> |
29 |
<field name='cycleTime' type='SFTime' accessType='outputOnly'
appinfo='cycleTime sends a time event at startTime, and also at the beginning of each new cycle'/> |
30 |
<field name='time' type='SFTime' accessType='outputOnly'
appinfo='absolute time (since January 1, 1970) for each event loop'/> |
31 |
<field name='pauseTime' type='SFTime' accessType='inputOutput'
appinfo='when current time exceeds pauseTime, isPaused becomes false and sensor becomes paused'/> |
32 |
<field name='isPaused' type='SFBool' accessType='outputOnly'
appinfo='isPaused true/false events are sent when TimeSensor is paused/resumed'/> |
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='resumeTime' type='SFTime' accessType='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='TransformBoxLinear' translation='-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='TransformBoxEasy' translation='-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='TextColor' diffuseColor='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='TouchSensorActive' description='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='LinearClock' cycleInterval='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='MoveLinear' key='0 1' keyValue='-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='TimeSensorEaseInEaseOut' DEF='EasyClock'> |
76 | <fieldValue name='cycleInterval' value='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='MoveEasy' key='0 1' keyValue='-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 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 |
LinearClock
TimeSensor set_startTime SFTime |
then
|
LinearClock
TimeSensor fraction_changed SFFloat |
MoveLinear
PositionInterpolator set_fraction SFFloat |
then
|
MoveLinear
PositionInterpolator value_changed SFVec3f |
TransformBoxLinear
Transform set_translation SFVec3f |
|||
TouchSensorActive
TouchSensor touchTime SFTime |
EasyClock
ProtoInstance startTime SFTime |
then
|
EasyClock
ProtoInstance fraction_changed SFFloat |
MoveEasy
PositionInterpolator set_fraction SFFloat |
then
|
MoveEasy
PositionInterpolator value_changed SFVec3f |
TransformBoxEasy
Transform set_translation SFVec3f |
EasyClock
ProtoInstance fraction_changed SFFloat |
MoveEasy
PositionInterpolator set_fraction SFFloat |
then
|
MoveEasy
PositionInterpolator value_changed SFVec3f |
TransformBoxEasy
Transform set_translation SFVec3f |
<!--
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)
<ProtoInstance name='ProtoName'>
<field
name='fieldName'/> </ProtoInstance>
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->