X3D Model Documentation: DraggingSphere.x3d

  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='Interchange' version='3.0 xmlns:xsd='https://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  4       <head>
  5            <meta name='titlecontent=' DraggingSphere.x3d '/>
  6            <meta name='descriptioncontent='A sphere that drags its tail around a box in the XY-plane'/>
  7            <meta name='creatorcontent='Matthew Braun'/>
  8            <meta name='createdcontent='24 July 2001'/>
  9            <meta name='modifiedcontent='20 October 2019'/>
 10            <meta name='rightscontent='Copyright (c) Matthew Braun, 2001'/>
 11            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/DraggingSphere.x3d '/>
 12            <meta name='generatorcontent='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 13            <meta name='licensecontent='../license.html'/>
 14       </head>
<!--

Event Graph ROUTE Table shows event connections.

--> <!-- to top DEF nodes index: CLOCK1, ColorINT, CYL_TF, CYLSHAPE, OrientINT, POSINT1, POSINT2, POSINT3, ScalarInt, SPH_MAT, SPHERE, SPHERETF1, SPHERETF2

Index for Viewpoint node: Viewpoint_1

-->
 15       <Scene>
 16            <!-- The scene is composed of two spheres and one cylinder. The spheres move in a box in the xy-plane. The cylinder moves in the same box, and expands and rotates to give the appearance of stretching between the spheres. -->
 17            <WorldInfo title='DraggingSphere.x3d'/>
 18            <Group>
 19                 <Viewpoint description='Startposition='-2 2 7'/>
 20                 <!-- The leading sphere -->
 21 
               <!-- ROUTE information for SPHERETF1 node:  [from POSINT1.value_changed to set_translation ] -->
               <Transform DEF='SPHERETF1'>
 22 
                    <!-- Shape SPHERE is a DEF node that has 1 USE node: USE_1 -->
                    <Shape DEF='SPHERE'>
 23                           <Appearance>
 24 
                              <!-- Material SPH_MAT is a DEF node that has 1 USE node: USE_1
                              <!-- ROUTE information for SPH_MAT node:  [from ColorINT.value_changed to set_diffuseColor ] [from ColorINT.value_changed to set_emissiveColor ] -->
                              <Material DEF='SPH_MATambientIntensity='0.9diffuseColor='.0 .0 .0'/>
 25                           </Appearance>
 26                           <Sphere radius='0.5'/>
 27                      </Shape>
 28                 </Transform>
 29                 <!-- Trailing sphere -->
 30 
               <!-- ROUTE information for SPHERETF2 node:  [from POSINT2.value_changed to set_translation ] -->
               <Transform DEF='SPHERETF2'>
 31                      <Shape USE='SPHERE'/>
 32                 </Transform>
 33 
               <!-- ROUTE information for CYL_TF node:  [from POSINT3.value_changed to set_translation ] [from OrientINT.value_changed to set_rotation ] [from ScalarInt.value_changed to set_scale ] -->
               <Transform DEF='CYL_TFrotation='0 0 -1 1.571scale='1 2 1translation='-1 0 0'>
 34                      <Shape DEF='CYLSHAPE'>
 35                           <Appearance>
 36                                <Material USE='SPH_MAT'/>
 37                           </Appearance>
 38                           <Cylinder radius='0.50'/>
 39                      </Shape>
 40                 </Transform>
 41            </Group>
 42            <!-- ColorInt for diffuse and emissive color -->
 43 
          <!-- ROUTE information for ColorINT node:  [from CLOCK1.fraction_changed to set_fraction ] [from value_changed to SPH_MAT.set_diffuseColor ] [from value_changed to SPH_MAT.set_emissiveColor ] -->
          <ColorInterpolator DEF='ColorINTkey='0 .25 .50 .75 1.0keyValue='0.8 0.8 0.8 0.1 0.1 0.9 0.1 0.9 0.1 0.9 0.1 0.1 0.8 0.8 0.8'/>
 44            <!-- PosInt for the first sphere: a square in the XY-plane. -->
 45 
          <!-- ROUTE information for POSINT1 node:  [from CLOCK1.fraction_changed to set_fraction ] [from value_changed to SPHERETF1.set_translation ] -->
          <PositionInterpolator DEF='POSINT1key='0 0.08 0.16 0.25 0.33 0.41 0.50 0.58 0.66 0.75 0.83 0.91 1.0keyValue='0.0 0.0 0.0 -2.0 0.0 0.0 -4.0 0.0 0.0 -4.0 0.0 0.0 -4.0 2.0 0.0 -4.0 4.0 0.0 -4.0 4.0 0.0 -2.0 4.0 0.0 0.0 4.0 0.0 0.0 4.0 0.0 0.0 2.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0'/>
 46            <!-- PosInt for second Sphere:a square in the XY-plane. -->
 47 
          <!-- ROUTE information for POSINT2 node:  [from CLOCK1.fraction_changed to set_fraction ] [from value_changed to SPHERETF2.set_translation ] -->
          <PositionInterpolator DEF='POSINT2key='0 0.08 0.16 0.25 0.33 0.41 0.50 0.58 0.66 0.75 0.83 0.91 1.0keyValue='0.0 0.0 0.0 0.0 0.0 0.0 -2.0 0.0 0.0 -4.0 0.0 0.0 -4.0 0.0 0.0 -4.0 2.0 0.0 -4.0 4.0 0.0 -4.0 4.0 0.0 -2.0 4.0 0.0 0.0 4.0 0.0 0.0 4.0 0.0 0.0 2.0 0.0 0.0 0.0 0.0'/>
 48            <!-- PosInt for the Cylinder: a square in the XY-plane. -->
 49 
          <!-- ROUTE information for POSINT3 node:  [from CLOCK1.fraction_changed to set_fraction ] [from value_changed to CYL_TF.set_translation ] -->
          <PositionInterpolator DEF='POSINT3key='0 0.08 0.16 0.25 0.33 0.41 0.50 0.58 0.66 0.75 0.83 0.91 1.0keyValue='0.0 0.0 0.0 -1.0 0.0 0.0 -3.0 0.0 0.0 -4.0 0.0 0.0 -4.0 1.0 0.0 -4.0 3.0 0.0 -4.0 4.0 0.0 -3.0 4.0 0.0 -1.0 4.0 0.0 0.0 4.0 0.0 0.0 3.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0'/>
 50            <!-- OrientationINT for the Cylinder. -->
 51 
          <!-- ROUTE information for OrientINT node:  [from CLOCK1.fraction_changed to set_fraction ] [from value_changed to CYL_TF.set_rotation ] -->
          <OrientationInterpolator DEF='OrientINTkey='0.00 0.25 0.25 0.50 0.50 0.75 0.75 1.00keyValue='0 0 1 1.57 0 0 1 1.57 0 0 0 0 0 0 0 0 0 0 1 1.57 0 0 1 1.57 0 0 0 0 0 0 0 0'/>
 52            <!-- ScalarInt for cylinder height. -->
 53 
          <!-- ROUTE information for ScalarInt node:  [from CLOCK1.fraction_changed to set_fraction ] [from value_changed to CYL_TF.set_scale ] -->
          <PositionInterpolator DEF='ScalarIntkey='0 0.08 0.16 0.25 0.33 0.41 0.50 0.58 0.66 0.75 0.83 0.91 1.0keyValue='1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1'/>
 54            <!-- World clock for all objects. -->
 55 
 56            <!-- Routes from clock to first sphere -->
 57            < ROUTE  fromNode='CLOCK1' fromField='fraction_changed' toNode='POSINT1' toField='set_fraction'/>
 58            < ROUTE  fromNode='POSINT1' fromField='value_changed' toNode='SPHERETF1' toField='set_translation'/>
 59            <!-- Routes from clock to second sphere -->
 60            < ROUTE  fromNode='CLOCK1' fromField='fraction_changed' toNode='POSINT2' toField='set_fraction'/>
 61            < ROUTE  fromNode='POSINT2' fromField='value_changed' toNode='SPHERETF2' toField='set_translation'/>
 62            <!-- Routes from clock to first sphere -->
 63            < ROUTE  fromNode='CLOCK1' fromField='fraction_changed' toNode='ColorINT' toField='set_fraction'/>
 64            < ROUTE  fromNode='ColorINT' fromField='value_changed' toNode='SPH_MAT' toField='set_diffuseColor'/>
 65            < ROUTE  fromNode='ColorINT' fromField='value_changed' toNode='SPH_MAT' toField='set_emissiveColor'/>
 66            <!-- Routes for Cylinder movement -->
 67            < ROUTE  fromNode='CLOCK1' fromField='fraction_changed' toNode='POSINT3' toField='set_fraction'/>
 68            < ROUTE  fromNode='POSINT3' fromField='value_changed' toNode='CYL_TF' toField='set_translation'/>
 69            <!-- Routes for Cylinder rotation -->
 70            < ROUTE  fromNode='CLOCK1' fromField='fraction_changed' toNode='OrientINT' toField='set_fraction'/>
 71            < ROUTE  fromNode='OrientINT' fromField='value_changed' toNode='CYL_TF' toField='set_rotation'/>
 72            <!-- Routes for Cylinder stretching -->
 73            < ROUTE  fromNode='CLOCK1' fromField='fraction_changed' toNode='ScalarInt' toField='set_fraction'/>
 74            < ROUTE  fromNode='ScalarInt' fromField='value_changed' toNode='CYL_TF' toField='set_scale'/>
 75       </Scene>
 76  </X3D>
<!--

Event Graph ROUTE Table shows event connections.

--> <!-- to top DEF nodes index: CLOCK1, ColorINT, CYL_TF, CYLSHAPE, OrientINT, POSINT1, POSINT2, POSINT3, ScalarInt, SPH_MAT, SPHERE, SPHERETF1, SPHERETF2

Index for Viewpoint node: Viewpoint_1

-->
X3D Tooltips element index: to top Appearance, ColorInterpolator, Cylinder, Group, head, Material, meta, OrientationInterpolator, PositionInterpolator, ROUTE, Scene, Shape, Sphere, TimeSensor, Transform, Viewpoint, WorldInfo, X3D,
plus documentation for accessType definitions, type definitions, XML data types, and field types

🔖   Event Graph ROUTE Table entries with 2 ROUTE connections, showing X3D event-model relationships for this scene.

Each row with a ROUTE statement shows an event cascade that may occur during a single timestamp interval between frame renderings, performed as part of the X3D execution model.

CLOCK1
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(1)
POSINT1
PositionInterpolator
set_fraction
SFFloat
then
from
same
node
POSINT1
PositionInterpolator
value_changed
SFVec3f
→
ROUTE
event to
(2)
SPHERETF1
Transform
set_translation
SFVec3f
CLOCK1
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(1)
POSINT2
PositionInterpolator
set_fraction
SFFloat
then
from
same
node
POSINT2
PositionInterpolator
value_changed
SFVec3f
→
ROUTE
event to
(2)
SPHERETF2
Transform
set_translation
SFVec3f
CLOCK1
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(1)
ColorINT
ColorInterpolator
set_fraction
SFFloat
then
from
same
node
ColorINT
ColorInterpolator
value_changed
SFColor
→
ROUTE
event to
(2)
SPH_MAT
Material
set_diffuseColor
SFColor
  then
from
same
node
ColorINT
ColorInterpolator
value_changed
SFColor
→
ROUTE
event to
(2)
SPH_MAT
Material
set_emissiveColor
SFColor
CLOCK1
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(1)
POSINT3
PositionInterpolator
set_fraction
SFFloat
then
from
same
node
POSINT3
PositionInterpolator
value_changed
SFVec3f
→
ROUTE
event to
(2)
CYL_TF
Transform
set_translation
SFVec3f
CLOCK1
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(1)
OrientINT
OrientationInterpolator
set_fraction
SFFloat
then
from
same
node
OrientINT
OrientationInterpolator
value_changed
SFRotation
→
ROUTE
event to
(2)
CYL_TF
Transform
set_rotation
SFRotation
CLOCK1
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(1)
ScalarInt
PositionInterpolator
set_fraction
SFFloat
then
from
same
node
ScalarInt
PositionInterpolator
value_changed
SFVec3f
→
ROUTE
event to
(2)
CYL_TF
Transform
set_scale
SFVec3f

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/Basic/StudentProjects/DraggingSphereIndex.html -->
<!-- SourceForge version control Version control at    
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/StudentProjects/DraggingSphere.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)
-->

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