Something went wrong on our end
TimeSensorEaseInEaseOutExample.x3d 6.03 KiB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.2//EN" "https://www.web3d.org/specifications/x3d-3.2.dtd">
<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'>
<head>
<meta content='TimeSensorEaseInEaseOutExample.x3d' name='title'/>
<meta content='Time sensor ease-in ease-out design pattern: example use.' name='description'/>
<meta content='Don Brutzman and MV4205 class' name='creator'/>
<meta content='4 April 2006' name='created'/>
<meta content='28 November 2019' name='modified'/>
<meta content='TimeSensorEaseInEaseOutPrototype.x3d' name='reference'/>
<meta content='TimeDelaySensorExample.x3d' name='reference'/>
<meta content='TimeSensorEaseInEaseOut.png' name='reference'/>
<meta content='TimeDelaySensor' name='subject'/>
<meta content='X3D v3.1 or greater' name='info'/>
<meta content='https://savage.nps.edu/Savage/Tools/Animation/TimeSensorEaseInEaseOutExample.x3d' name='identifier'/>
<meta content='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit' name='generator'/>
<meta content='../../license.html' name='license'/>
</head>
<Scene>
<WorldInfo title='TimeSensorEaseInEaseOutExample.x3d'/>
<ExternProtoDeclare appinfo='TimeSensorEaseInEaseOut is a TimeSensor node with gradual start and stop rates' name='TimeSensorEaseInEaseOut' url='"TimeSensorEaseInEaseOutPrototype.x3d#TimeSensorEaseInEaseOut" "../../../Savage/Tools/Animation/TimeSensorEaseInEaseOutPrototype.x3d#TimeSensorEaseInEaseOut" "https://savage.nps.edu/Savage/Tools/Animation/TimeSensorEaseInEaseOutPrototype.x3d#TimeSensorEaseInEaseOut" "TimeSensorEaseInEaseOutPrototype.wrl#TimeSensorEaseInEaseOut" "../../../Savage/Tools/Animation/TimeSensorEaseInEaseOutPrototype.wrl#TimeSensorEaseInEaseOut" "https://savage.nps.edu/Savage/Tools/Animation/TimeSensorEaseInEaseOutPrototype.wrl#TimeSensorEaseInEaseOut"'>
<field accessType='inputOutput' appinfo='whether sensor is active' name='enabled' type='SFBool'/>
<field accessType='inputOutput' appinfo='loop duration in seconds' name='cycleInterval' type='SFTime'/>
<field accessType='outputOnly' appinfo='fraction_changed sends values in range [0,1] showing time progress in the current cycle' name='fraction_changed' type='SFFloat'/>
<field accessType='inputOutput' appinfo='repeat indefinitely when loop=true, repeat only once when loop=false' name='loop' type='SFBool'/>
<field accessType='outputOnly' appinfo='isActive true/false events are sent when TimeSensor starts/stops running' name='isActive' type='SFBool'/>
<field accessType='inputOutput' appinfo='when current time exceeds startTime, isActive becomes true and sensor becomes active' name='startTime' type='SFTime'/>
<field accessType='inputOutput' appinfo='when current time exceeds stopTime, isActive becomes false and sensor becomes inactive' name='stopTime' type='SFTime'/>
<field accessType='outputOnly' appinfo='cycleTime sends a time event at startTime, and also at the beginning of each new cycle' name='cycleTime' type='SFTime'/>
<field accessType='outputOnly' appinfo='absolute time (since January 1, 1970) for each event loop' name='time' type='SFTime'/>
<field accessType='inputOutput' appinfo='when current time exceeds pauseTime, isPaused becomes false and sensor becomes paused' name='pauseTime' type='SFTime'/>
<field accessType='outputOnly' appinfo='isPaused true/false events are sent when TimeSensor is paused/resumed' name='isPaused' type='SFBool'/>
<field accessType='outputOnly' appinfo='elapsed time since TimeSensor activated/running, cumulative in seconds, not counting any paused time' name='elapsedTime' type='SFTime'/>
<field accessType='inputOutput' appinfo='when current time exceeds resumeTime, isPaused becomes false and sensor resumes running' name='resumeTime' type='SFTime'/>
</ExternProtoDeclare>
<!-- ==================== -->
<Transform DEF='TransformBoxLinear' translation='-3 2 0'>
<Shape>
<Box/>
<Appearance>
<Material/>
</Appearance>
</Shape>
</Transform>
<Transform DEF='TransformBoxEasy' translation='-3 1 0'>
<Shape>
<Box/>
<Appearance>
<Material diffuseColor='0.9 0.3 0.2'/>
</Appearance>
</Shape>
</Transform>
<Transform translation='0 -2 0'>
<Group DEF='TextTouchGroup'>
<Shape>
<Text string='"click text to move Boxes:" "linear TimeSensor grey" "EaseInEaseOut red"'>
<FontStyle justify='"MIDDLE" "MIDDLE"'/>
</Text>
<Appearance>
<Material DEF='TextColor' diffuseColor='0 0.7 0.7'/>
</Appearance>
</Shape>
<TouchSensor DEF='TouchSensorActive' description='click to initiate time delay and color change'/>
</Group>
</Transform>
<!-- ==================== -->
<Group DEF='TextAnimationLinearGroup'>
<TimeSensor DEF='LinearClock' cycleInterval='3'/>
<ROUTE fromField='touchTime' fromNode='TouchSensorActive' toField='set_startTime' toNode='LinearClock'/>
<PositionInterpolator DEF='MoveLinear' key='0 1' keyValue='-3 2 0 3 2 0'/>
<ROUTE fromField='fraction_changed' fromNode='LinearClock' toField='set_fraction' toNode='MoveLinear'/>
<ROUTE fromField='value_changed' fromNode='MoveLinear' toField='set_translation' toNode='TransformBoxLinear'/>
</Group>
<Group DEF='TextAnimationEasedGroup'>
<ProtoInstance DEF='EasyClock' name='TimeSensorEaseInEaseOut'>
<fieldValue name='cycleInterval' value='3'/>
</ProtoInstance>
<ROUTE fromField='touchTime' fromNode='TouchSensorActive' toField='startTime' toNode='EasyClock'/>
<PositionInterpolator DEF='MoveEasy' key='0 1' keyValue='-3 1 0 3 1 0'/>
<ROUTE fromField='fraction_changed' fromNode='EasyClock' toField='set_fraction' toNode='MoveEasy'/>
<ROUTE fromField='value_changed' fromNode='MoveEasy' toField='set_translation' toNode='TransformBoxEasy'/>
</Group>
</Scene>
</X3D>