X3D Model Documentation: StopWatch.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2  <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
  3  <X3D profile='Interactive' version='3.3 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'>
  4       <head>
  5            <meta name='titlecontent='StopWatch.x3d'/>
  6            <meta name='descriptioncontent='Stop-watch with automatically moving second, minute, and hour hands, start and stop buttons, and a stop-watch sweep second hand.'/>
  7            <meta name='creatorcontent='David R. Nadeau'/>
  8            <meta name='translatorcontent='Don Brutzman'/>
  9            <meta name='createdcontent='1 July 1998'/>
 10            <meta name='translatedcontent='2 February 2014'/>
 11            <meta name='modifiedcontent='20 October 2019'/>
 12            <meta name='Imagecontent='StopWatch.png'/>
 13            <meta name='referencecontent='originals/stopwtch.wrl'/>
 14            <meta name='referencecontent='http://www.siggraph.org/s98'/>
 15            <meta name='referencecontent='http://www.siggraph.org/s98/conference/courses/18.html'/>
 16            <meta name='referencecontent='http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/slides/mt0256.htm'/>
 17            <meta name='referencecontent='http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/vrml97.htm'/>
 18            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/X3dResources.html'/>
 19            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/StopWatch.x3d'/>
 20            <meta name='generatorcontent='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/>
 21            <meta name='generatorcontent='X3D-Edit, https://savage.nps.edu/X3D-Edit'/>
 22            <meta name='licensecontent='../license.html'/>
 23       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: Arm, ArrowHead, Black, HourHand, HourSpinner, HourTimer, MinuteHand, MinuteSpinner, MinuteTimer, QuarterAnimation, QuarterHour, QuarterSpinner, QuarterSquisher, Red, SecondHand, SecondSpinner, SecondTimer, Start, Stop, StopWatch, SweepHand, SweepSpinner, SweepTimer

Index for Viewpoint node: Viewpoint_1
-->
 24       <Scene>
 25            <WorldInfo info='"Copyright (c) 1997, David R. Nadeau"title='Stop watch'/>
 26            <Viewpoint description='Entry viewposition='0.0 0.0 15.0'/>
 27            <NavigationInfo/>
 28 
          <!-- ROUTE information for StopWatch node:  [from QuarterSpinner.value_changed to set_rotation ] [from QuarterSquisher.value_changed to set_scale ] -->
          <Transform DEF='StopWatch'>
 29                 <Transform rotation='1.0 0.0 0.0 1.571'>
 30                      <Shape>
 31                           <Appearance>
 32                                <Material diffuseColor='0.7 0.3 0.0'/>
 33                           </Appearance>
 34                           <Cylinder height='0.8radius='4.8'/>
 35                      </Shape>
 36                      <Shape>
 37                           <Appearance>
 38                                <Material diffuseColor='1.0 1.0 1.0'/>
 39                           </Appearance>
 40                           <Cylinder height='0.9radius='4.0'/>
 41                      </Shape>
 42                 </Transform>
 43                 <Transform rotation='0.0 0.0 1.0 -0.71translation='3.5 3.5 0.0'>
 44 
                    <!-- ROUTE information for Start node:  [from touchTime to SweepTimer.set_startTime ] -->
                    <TouchSensor DEF='Start'/>
 45                      <Shape>
 46                           <Appearance>
 47                                <Material diffuseColor='0.0 1.0 0.0'/>
 48                           </Appearance>
 49                           <Cylinder height='0.3radius='0.38'/>
 50                      </Shape>
 51                 </Transform>
 52                 <Transform rotation='0.0 0.0 1.0 0.71translation='-3.5 3.5 0.0'>
 53 
                    <!-- ROUTE information for Stop node:  [from touchTime to SweepTimer.set_stopTime ] -->
                    <TouchSensor DEF='Stop'/>
 54                      <Shape>
 55                           <Appearance>
 56                                <Material diffuseColor='1.0 0.0 0.0'/>
 57                           </Appearance>
 58                           <Cylinder height='0.3radius='0.38'/>
 59                      </Shape>
 60                 </Transform>
 61 
               <!-- ROUTE information for MinuteHand node:  [from MinuteSpinner.value_changed to set_rotation ] -->
               <Transform DEF='MinuteHandcenter='0.0 -1.5 0.6translation='0.0 1.5 0.6'>
 62 
                    <!-- Shape Arm is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
                    <Shape DEF='Arm'>
 63 
                         <!-- Appearance Black is a DEF node that has 1 USE node: USE_1 -->
                         <Appearance DEF='Black'>
 64                                <Material diffuseColor='0.2 0.2 0.2'/>
 65                           </Appearance>
 66                           <Cylinder height='3.0radius='0.17'/>
 67                      </Shape>
 68 
                    <!-- Transform ArrowHead is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
                    <Transform DEF='ArrowHeadtranslation='0.0 1.9 0.0'>
 69                           <Shape>
 70                                <Appearance USE='Black'/>
 71                                <Cone bottomRadius='0.4height='0.8'/>
 72                           </Shape>
 73                      </Transform>
 74                 </Transform>
 75 
               <!-- ROUTE information for HourHand node:  [from HourSpinner.value_changed to set_rotation ] -->
               <Transform DEF='HourHandcenter='0.0 -1.5 0.6scale='1.0 0.7 1.0translation='0.0 1.5 0.6'>
 76                      <Shape USE='Arm'/>
 77                      <Transform USE='ArrowHead'/>
 78                 </Transform>
 79 
               <!-- ROUTE information for SecondHand node:  [from SecondSpinner.value_changed to set_rotation ] -->
               <Transform DEF='SecondHandcenter='0.0 -1.5 0.6scale='0.6 1.0 0.6translation='0.0 1.5 0.6'>
 80                      <Shape USE='Arm'/>
 81                      <Transform USE='ArrowHead'/>
 82                 </Transform>
 83 
               <!-- ROUTE information for SweepHand node:  [from SweepSpinner.value_changed to set_rotation ] -->
               <Transform DEF='SweepHandcenter='0.0 -1.9 0.6scale='0.6 1.0 0.6translation='0.0 1.9 0.6'>
 84                      <Shape>
 85                           <Appearance DEF='Red'>
 86                                <Material diffuseColor='1.0 0.0 0.0'/>
 87                           </Appearance>
 88                           <Cylinder height='3.8radius='0.17'/>
 89                      </Shape>
 90                 </Transform>
 91            </Transform>
 92 
          <!-- ROUTE information for SecondTimer node:  [from fraction_changed to SecondSpinner.set_fraction ] -->
          <TimeSensor DEF='SecondTimercycleInterval='60.0loop='truestopTime='-1.0'/>
 93 
          <!-- ROUTE information for MinuteTimer node:  [from fraction_changed to MinuteSpinner.set_fraction ] -->
          <TimeSensor DEF='MinuteTimercycleInterval='3600.0loop='truestopTime='-1.0'/>
 94 
          <!-- ROUTE information for HourTimer node:  [from fraction_changed to HourSpinner.set_fraction ] -->
          <TimeSensor DEF='HourTimercycleInterval='43200.0loop='truestartTime='28800.0stopTime='-1.0'/>
 95 
          <!-- ROUTE information for SecondSpinner node:  [from SecondTimer.fraction_changed to set_fraction ] [from value_changed to SecondHand.set_rotation ] -->
          <OrientationInterpolator DEF='SecondSpinnerkey='0.0 0.5 1.0keyValue='0.0 0.0 1.0 0.0 0.0 0.0 1.0 -3.14 0.0 0.0 1.0 -6.28'/>
 96 
          <!-- ROUTE information for MinuteSpinner node:  [from MinuteTimer.fraction_changed to set_fraction ] [from value_changed to MinuteHand.set_rotation ] -->
          <OrientationInterpolator DEF='MinuteSpinnerkey='0.0 0.5 1.0keyValue='0.0 0.0 1.0 0.0 0.0 0.0 1.0 -3.14 0.0 0.0 1.0 -6.28'/>
 97 
          <!-- ROUTE information for HourSpinner node:  [from HourTimer.fraction_changed to set_fraction ] [from value_changed to HourHand.set_rotation ] -->
          <OrientationInterpolator DEF='HourSpinnerkey='0.0 0.5 1.0keyValue='0.0 0.0 1.0 0.0 0.0 0.0 1.0 -3.14 0.0 0.0 1.0 -6.28'/>
 98            < ROUTE  fromNode='SecondTimer' fromField='fraction_changed' toNode='SecondSpinner' toField='set_fraction'/>
 99            < ROUTE  fromNode='MinuteTimer' fromField='fraction_changed' toNode='MinuteSpinner' toField='set_fraction'/>
100            < ROUTE  fromNode='HourTimer' fromField='fraction_changed' toNode='HourSpinner' toField='set_fraction'/>
101            < ROUTE  fromNode='SecondSpinner' fromField='value_changed' toNode='SecondHand' toField='set_rotation'/>
102            < ROUTE  fromNode='MinuteSpinner' fromField='value_changed' toNode='MinuteHand' toField='set_rotation'/>
103            < ROUTE  fromNode='HourSpinner' fromField='value_changed' toNode='HourHand' toField='set_rotation'/>
104 
          <!-- ROUTE information for SweepTimer node:  [from Start.touchTime to set_startTime ] [from Stop.touchTime to set_stopTime ] [from fraction_changed to SweepSpinner.set_fraction ] -->
          <TimeSensor DEF='SweepTimercycleInterval='60.0loop='truestopTime='1.0'/>
105 
          <!-- ROUTE information for SweepSpinner node:  [from SweepTimer.fraction_changed to set_fraction ] [from value_changed to SweepHand.set_rotation ] -->
          <OrientationInterpolator DEF='SweepSpinnerkey='0.0 0.5 1.0keyValue='0.0 0.0 1.0 0.0 0.0 0.0 1.0 -3.14 0.0 0.0 1.0 -6.28'/>
106            < ROUTE  fromNode='Start' fromField='touchTime' toNode='SweepTimer' toField='set_startTime'/>
107            < ROUTE  fromNode='Stop' fromField='touchTime' toNode='SweepTimer' toField='set_stopTime'/>
108            < ROUTE  fromNode='SweepTimer' fromField='fraction_changed' toNode='SweepSpinner' toField='set_fraction'/>
109            < ROUTE  fromNode='SweepSpinner' fromField='value_changed' toNode='SweepHand' toField='set_rotation'/>
110 
          <!-- ROUTE information for QuarterHour node:  [from cycleTime to QuarterAnimation.set_startTime ] -->
          <TimeSensor DEF='QuarterHourcycleInterval='900.0loop='truestartTime='28800.0stopTime='-1.0'/>
111 
          <!-- ROUTE information for QuarterAnimation node:  [from QuarterHour.cycleTime to set_startTime ] [from fraction_changed to QuarterSpinner.set_fraction ] [from fraction_changed to QuarterSquisher.set_fraction ] -->
          <TimeSensor DEF='QuarterAnimationcycleInterval='3.0startTime='-1.0'/>
112 
          <!-- ROUTE information for QuarterSpinner node:  [from QuarterAnimation.fraction_changed to set_fraction ] [from value_changed to StopWatch.set_rotation ] -->
          <OrientationInterpolator DEF='QuarterSpinnerkey='0.0 0.5 1.0keyValue='1.0 1.0 0.0 0.0 1.0 1.0 0.0 -3.14 1.0 1.0 0.0 -6.28'/>
113 
          <!-- ROUTE information for QuarterSquisher node:  [from QuarterAnimation.fraction_changed to set_fraction ] [from value_changed to StopWatch.set_scale ] -->
          <PositionInterpolator DEF='QuarterSquisherkey='0.0 0.25 0.5 0.75 1.0keyValue='1.0 1.0 1.0 0.1 3.0 1.2 3.0 0.1 1.0 0.3 2.0 1.2 1.0 1.0 1.0'/>
114            < ROUTE  fromNode='QuarterHour' fromField='cycleTime' toNode='QuarterAnimation' toField='set_startTime'/>
115            < ROUTE  fromNode='QuarterAnimation' fromField='fraction_changed' toNode='QuarterSpinner' toField='set_fraction'/>
116            < ROUTE  fromNode='QuarterAnimation' fromField='fraction_changed' toNode='QuarterSquisher' toField='set_fraction'/>
117            < ROUTE  fromNode='QuarterSpinner' fromField='value_changed' toNode='StopWatch' toField='set_rotation'/>
118            < ROUTE  fromNode='QuarterSquisher' fromField='value_changed' toNode='StopWatch' toField='set_scale'/>
119       </Scene>
120  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: Arm, ArrowHead, Black, HourHand, HourSpinner, HourTimer, MinuteHand, MinuteSpinner, MinuteTimer, QuarterAnimation, QuarterHour, QuarterSpinner, QuarterSquisher, Red, SecondHand, SecondSpinner, SecondTimer, Start, Stop, StopWatch, SweepHand, SweepSpinner, SweepTimer

Index for Viewpoint node: Viewpoint_1
-->
X3D Tooltips element index: Appearance, Cone, Cylinder, head, Material, meta, NavigationInfo, OrientationInterpolator, PositionInterpolator, ROUTE, Scene, Shape, TimeSensor, TouchSensor, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

Event Graph ROUTE Table entries with 15 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.

Start
TouchSensor
touchTime
SFTime

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

ROUTE
event to
(2)
SweepSpinner
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
SweepSpinner
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(3)
SweepHand
Transform
set_rotation
SFRotation

Stop
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
SweepTimer
TimeSensor
set_stopTime
SFTime
then
 
 
 
SweepTimer
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
SweepSpinner
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
SweepSpinner
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(3)
SweepHand
Transform
set_rotation
SFRotation

HourTimer
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
HourSpinner
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
HourSpinner
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(2)
HourHand
Transform
set_rotation
SFRotation

MinuteTimer
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
MinuteSpinner
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
MinuteSpinner
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(2)
MinuteHand
Transform
set_rotation
SFRotation

QuarterHour
TimeSensor
cycleTime
SFTime

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

ROUTE
event to
(2)
QuarterSpinner
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
QuarterSpinner
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(3)
StopWatch
Transform
set_rotation
SFRotation
  then
 
 
 
QuarterAnimation
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
QuarterSquisher
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
QuarterSquisher
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(3)
StopWatch
Transform
set_scale
SFVec3f

SecondTimer
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
SecondSpinner
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
SecondSpinner
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(2)
SecondHand
Transform
set_rotation
SFRotation

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/Vrml2Sourcebook/Siggraph98Course/StopWatchIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/StopWatch.x3d -->

<!-- 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)
-->

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