1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
|
3 | <X3D profile='Immersive' version='3.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'> |
4 | <head> |
5 | <meta name='title' content='TimeDelaySensorExample.x3d'/> |
6 | <meta name='description' content='Time delay sensor design pattern: example use.'/> |
7 | <meta name='creator' content='Don Brutzman and MV4204 class'/> |
8 | <meta name='created' content='18 August 2003'/> |
9 | <meta name='modified' content='28 November 2019'/> |
10 | <meta name='reference' content='TimeDelaySensorPrototype.x3d'/> |
11 | <meta name='reference' content='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/time.html'/> |
12 | <meta name='reference' content='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/utils.html'/> |
13 | <meta name='subject' content='TimeDelaySensor'/> |
14 | <meta name='identifier' content='https://savage.nps.edu/Savage/Tools/Animation/TimeDelaySensorExample.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> |
18 | <Scene> |
19 | <WorldInfo title='TimeDelaySensorExample.x3d'/> |
20 | <ExternProtoDeclare name='TimeDelaySensor' appinfo='TimeSensor functionality commences after delayInterval pause' url=' "TimeDelaySensorPrototype.x3d#TimeDelaySensor" "https://savage.nps.edu/Savage/Tools/Animation/TimeDelaySensorPrototype.x3d#TimeDelaySensor" "TimeDelaySensorPrototype.wrl#TimeDelaySensor" "https://savage.nps.edu/Savage/Tools/Animation/TimeDelaySensorPrototype.wrl#TimeDelaySensor" '> |
21 |
<field name='description' type='SFString' accessType='inputOutput'
appinfo='describe the purpose of this sensor'/> |
22 | <field name='startTime' type='SFTime' accessType='inputOutput'/> |
23 | <field name='enabled' type='SFBool' accessType='inputOutput'/> |
24 |
<field name='delayInterval' type='SFTime' accessType='inputOutput'
appinfo='seconds'/> |
25 | <field name='delayCompleteTime' type='SFTime' accessType='outputOnly'/> |
26 | <field name='traceEnabled' type='SFBool' accessType='initializeOnly'/> |
27 | </ExternProtoDeclare> |
28 | <!-- ==================== --> |
29 | <Group DEF='TextTouchGroup'> |
30 | <Shape> |
31 | <Text string='"click text then wait for" "3 second time delay" "before color changes"'> |
32 | <FontStyle justify='"MIDDLE" "MIDDLE"'/> |
33 | </Text> |
34 | <Appearance> |
35 |
<!-- ROUTE information for TextColor node:
[from ColorChangerRGB.value_changed to diffuseColor
]
-->
<Material DEF='TextColor'/> |
36 | </Appearance> |
37 | </Shape> |
38 |
<!-- ROUTE information for TouchSensorActive node:
[from touchTime to DelayTimer.set_startTime
]
-->
<TouchSensor DEF='TouchSensorActive' description='click to initiate time delay and color change'/> |
39 | </Group> |
40 | <!-- ==================== --> |
41 | <Group DEF='TextAnimationGroup'> |
42 |
<!-- ROUTE information for DelayTimer node:
[from TouchSensorActive.touchTime to set_startTime
]
[from delayCompleteTime to AnimationClock.set_startTime
]
-->
<ProtoInstance name='TimeDelaySensor' DEF='DelayTimer'> |
43 | <fieldValue name='delayInterval' value='3'/> |
44 | <fieldValue name='traceEnabled' value='true'/> |
45 | </ProtoInstance> |
46 |
<!-- ROUTE information for AnimationClock node:
[from DelayTimer.delayCompleteTime to set_startTime
]
[from fraction_changed to ColorChangerRGB.set_fraction
]
-->
<TimeSensor DEF='AnimationClock' cycleInterval='2'/> |
47 | < ROUTE fromNode='TouchSensorActive' fromField='touchTime' toNode='DelayTimer' toField='set_startTime'/> |
48 | < ROUTE fromNode='DelayTimer' fromField='delayCompleteTime' toNode='AnimationClock' toField='set_startTime'/> |
49 |
<!-- ROUTE information for ColorChangerRGB node:
[from AnimationClock.fraction_changed to set_fraction
]
[from value_changed to TextColor.diffuseColor
]
-->
<ColorInterpolator DEF='ColorChangerRGB' key='0 0.5 1' keyValue='1 0 0 0 1 0 0 0 1'/> |
50 | < ROUTE fromNode='AnimationClock' fromField='fraction_changed' toNode='ColorChangerRGB' toField='set_fraction'/> |
51 | < ROUTE fromNode='ColorChangerRGB' fromField='value_changed' toNode='TextColor' toField='diffuseColor'/> |
52 | </Group> |
53 | </Scene> |
54 | </X3D> |
Event Graph ROUTE Table entries with 4 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 |
DelayTimer
ProtoInstance set_startTime UnknownFieldType |
then
|
DelayTimer
ProtoInstance delayCompleteTime SFTime |
AnimationClock
TimeSensor set_startTime SFTime |
then
|
AnimationClock
TimeSensor fraction_changed SFFloat |
ColorChangerRGB
ColorInterpolator set_fraction SFFloat |
then
|
ColorChangerRGB
ColorInterpolator value_changed SFColor |
TextColor
Material diffuseColor SFColor |
<!--
Color 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. -->