X3D Model Documentation: DoubleClickTouchSensorExample.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=' DoubleClickTouchSensorExample.x3d '/>
  6            <meta name='descriptioncontent='Double-click TouchSensor design pattern, showing example use.'/>
  7            <meta name='creatorcontent='Don Brutzman'/>
  8            <meta name='createdcontent='26 May 2003'/>
  9            <meta name='modifiedcontent='17 June 2020'/>
 10            <meta name='referencecontent=' DoubleClickTouchSensorPrototype.x3d '/>
 11            <meta name='referencecontent='https://www.web3d.org/x3d/specifications/ISO-IEC-19775-FDIS-X3dAbstractSpecification/Part01/components/pointingsensor.html#TouchSensor'/>
 12            <meta name='subjectcontent='DoubleClickTouchSensor'/>
 13            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/DoubleClickTouchSensorExample.x3d '/>
 14            <meta name='generatorcontent='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 15            <meta name='licensecontent='../../license.html'/>
 16       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: AnimationClock, ColorChangerRGB, DelayTimer, TextAnimationGroup, TextColor, TextTouchGroup, TouchSensorActive

Index for ExternProtoDeclare definitions: DoubleClickTouchSensor, TimeDelaySensor
-->
 17       <Scene>
 18            <WorldInfo title='DoubleClickTouchSensorExample.x3d'/>
 19            <ExternProtoDeclare name='TimeDelaySensorappinfo='TimeSensor functionality commences after delayInterval pause'   url=' "TimeDelaySensorPrototype.x3d#TimeDelaySensor" "../../../Savage/Tools/Animation/TimeDelaySensorPrototype.x3d#TimeDelaySensor" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/TimeDelaySensorPrototype.x3d#TimeDelaySensor" "TimeDelaySensorPrototype.wrl#TimeDelaySensor" "../../../Savage/Tools/Animation/TimeDelaySensorPrototype.wrl#TimeDelaySensor" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/TimeDelaySensorPrototype.wrl#TimeDelaySensor" '>
 20                 <field name='descriptiontype='SFStringaccessType='inputOutput'
                appinfo='describe the purpose of this sensor'/>
 21                 <field name='startTimetype='SFTimeaccessType='inputOutput'/>
 22                 <field name='enabledtype='SFBoolaccessType='inputOutput'/>
 23                 <field name='delayIntervaltype='SFTimeaccessType='inputOutput'
                appinfo='seconds'/>
 24                 <field name='delayCompleteTimetype='SFTimeaccessType='outputOnly'/>
 25                 <field name='traceEnabledtype='SFBoolaccessType='initializeOnly'/>
 26            </ExternProtoDeclare>
 27            <ExternProtoDeclare name='DoubleClickTouchSensorappinfo='DoubleClickTouchSensor functionality activates when user double clicks (or double selects) within maxDelayInterval'   url=' "DoubleClickTouchSensorPrototype.x3d#DoubleClickTouchSensor" "../../../Savage/Tools/Animation/DoubleClickTouchSensorPrototype.x3d#DoubleClickTouchSensor" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/DoubleClickTouchSensorPrototype.x3d#DoubleClickTouchSensor" "DoubleClickTouchSensorPrototype.wrl#DoubleClickTouchSensor" "../../../Savage/Tools/Animation/DoubleClickTouchSensorPrototype.wrl#DoubleClickTouchSensor" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/DoubleClickTouchSensorPrototype.wrl#DoubleClickTouchSensor" '>
 28                 <field name='descriptiontype='SFStringaccessType='inputOutput'
                appinfo='describe the purpose of this sensor'/>
 29                 <field name='maxDelayIntervaltype='SFTimeaccessType='initializeOnly'
                appinfo='seconds'/>
 30                 <field name='enabledtype='SFBoolaccessType='inputOutput'/>
 31                 <field name='isActivetype='SFBoolaccessType='outputOnly'/>
 32                 <field name='isOvertype='SFBoolaccessType='outputOnly'/>
 33                 <field name='touchTimetype='SFTimeaccessType='outputOnly'
                appinfo='seconds'/>
 34                 <field name='hitPoint_changedtype='SFVec3faccessType='outputOnly'/>
 35                 <field name='hitNormal_changedtype='SFVec3faccessType='outputOnly'/>
 36                 <field name='hitTexCoord_changedtype='SFVec2faccessType='outputOnly'/>
 37                 <field name='metadatatype='SFNodeaccessType='initializeOnly'
                appinfo='can contain one of Metadata nodes'>
 38                      <!-- initialization node (if any) goes here -->
 39                 </field>
 40                 <field name='traceEnabledtype='SFBoolaccessType='initializeOnly'/>
 41            </ExternProtoDeclare>
 42            <!-- ==================== -->
 43            <Group DEF='TextTouchGroup'>
 44                 <Shape>
 45                      <Text string='"Double-click text then" "wait for 1-second time delay" "before color changes"'>
 46                           <FontStyle justify='"MIDDLE" "MIDDLE"'/>
 47                      </Text>
 48                      <Appearance>
 49 
                         <!-- ROUTE information for TextColor node:  [from ColorChangerRGB.value_changed to diffuseColor ] -->
                         <Material DEF='TextColor'/>
 50                      </Appearance>
 51                 </Shape>
 52 
               <!-- ROUTE information for TouchSensorActive node:  [from touchTime to DelayTimer.startTime ] -->
               <ProtoInstance name='DoubleClickTouchSensorDEF='TouchSensorActive'>
 53                      <fieldValue name='descriptionvalue='double click to initiate time delay and color change'/>
 54                      <fieldValue name='traceEnabledvalue='true'/>
 55                      <fieldValue name='metadata'>
 56                           <MetadataString name='exampleTermvalue='"exampleValue"'/>
 57                      </fieldValue>
 58                 </ProtoInstance>
 59                 <!-- ==================== -->
 60                 <Group DEF='TextAnimationGroup'>
 61 
                    <!-- ROUTE information for DelayTimer node:  [from TouchSensorActive.touchTime to startTime ] [from delayCompleteTime to AnimationClock.set_startTime ] -->
                    <ProtoInstance name='TimeDelaySensorDEF='DelayTimer'>
 62                           <fieldValue name='delayIntervalvalue='1'/>
 63                           <fieldValue name='traceEnabledvalue='true'/>
 64                      </ProtoInstance>
 65 
                    <!-- ROUTE information for AnimationClock node:  [from DelayTimer.delayCompleteTime to set_startTime ] [from fraction_changed to ColorChangerRGB.set_fraction ] -->
                    <TimeSensor DEF='AnimationClockcycleInterval='2'/>
 66                      < ROUTE  fromNode='TouchSensorActive' fromField='touchTime' toNode='DelayTimer' toField='startTime'/>
 67                      < ROUTE  fromNode='DelayTimer' fromField='delayCompleteTime' toNode='AnimationClock' toField='set_startTime'/>
 68 
                    <!-- ROUTE information for ColorChangerRGB node:  [from AnimationClock.fraction_changed to set_fraction ] [from value_changed to TextColor.diffuseColor ] -->
                    <ColorInterpolator DEF='ColorChangerRGBkey='0 0.5 1keyValue='1 0 0 0 1 0 0 0 1'/>
 69                      < ROUTE  fromNode='ColorChangerRGB' fromField='value_changed' toNode='TextColor' toField='diffuseColor'/>
 70                      < ROUTE  fromNode='AnimationClock' fromField='fraction_changed' toNode='ColorChangerRGB' toField='set_fraction'/>
 71                 </Group>
 72            </Group>
 73       </Scene>
 74  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: AnimationClock, ColorChangerRGB, DelayTimer, TextAnimationGroup, TextColor, TextTouchGroup, TouchSensorActive

Index for ExternProtoDeclare definitions: DoubleClickTouchSensor, TimeDelaySensor
-->
X3D Tooltips element index: Appearance, ColorInterpolator, ExternProtoDeclare, field, fieldValue, FontStyle, Group, head, Material, meta, MetadataString, ProtoInstance, ROUTE, Scene, Shape, Text, TimeSensor, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

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.

      DelayTimer
ProtoInstance
delayCompleteTime
SFTime

ROUTE
event to
(1)
AnimationClock
TimeSensor
set_startTime
SFTime
then
 
 
 
AnimationClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
ColorChangerRGB
ColorInterpolator
set_fraction
SFFloat
then
 
 
 
ColorChangerRGB
ColorInterpolator
value_changed
SFColor

ROUTE
event to
(3)
TextColor
Material
diffuseColor
SFColor

TouchSensorActive
ProtoInstance
touchTime
SFTime

ROUTE
event to
(1)
DelayTimer
ProtoInstance
startTime
SFTime
then
 
 
 
DelayTimer
ProtoInstance
delayCompleteTime
SFTime

ROUTE
event to
(2)
AnimationClock
TimeSensor
set_startTime
SFTime
then
 
 
 
AnimationClock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(3)
ColorChangerRGB
ColorInterpolator
set_fraction
SFFloat
then
 
 
 
ColorChangerRGB
ColorInterpolator
value_changed
SFColor

ROUTE
event to
(4)
TextColor
Material
diffuseColor
SFColor

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/DoubleClickTouchSensorExampleIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/Tools/Animation/DoubleClickTouchSensorExample.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)
    <ProtoInstance name='ProtoName'> <field name='fieldName'/> </ProtoInstance> -->

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