<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Interchange'  version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' https://www.web3d.org/specifications/x3d-3.0.xsd ' >
<head>
<meta name='titlecontent=' DraggingSphere.x3d '/>
<meta name='descriptioncontent='A sphere that drags its tail around a box in the XY-plane'/>
<meta name='creatorcontent='Matthew Braun'/>
<meta name='createdcontent='24 July 2001'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='rightscontent='Copyright (c) Matthew Braun, 2001'/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/DraggingSphere.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: CLOCK1, ColorINT, CYL_TF, CYLSHAPE, OrientINT, POSINT1, POSINT2, POSINT3, ScalarInt, SPH_MAT, SPHERE, SPHERETF1, SPHERETF2

Index for Viewpoint node: Viewpoint_1
-->
<Scene>
<!-- 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. -->
<WorldInfo title='DraggingSphere.x3d'/>
<Group>
<Viewpoint description='Startposition='-2 2 7'/>
<!-- The leading sphere -->
<!-- ROUTE information for SPHERETF1 node:  [from POSINT1.value_changed to set_translation ] -->
<Transform DEF='SPHERETF1'>
<Shape DEF='SPHERE'>
<Appearance>
<!-- 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'/>
</Appearance>
<Sphere radius='0.5'/>
</Shape>
</Transform>
<!-- Trailing sphere -->
<!-- ROUTE information for SPHERETF2 node:  [from POSINT2.value_changed to set_translation ] -->
<Transform DEF='SPHERETF2'>
<Shape USE=' SPHERE'/>
</Transform>
<!-- 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'>
<Shape DEF='CYLSHAPE'>
<Appearance>
<Material USE=' SPH_MAT'/>
</Appearance>
<Cylinder radius='0.50'/>
</Shape>
</Transform>
</Group>
<!-- ColorInt for diffuse and emissive color -->
<!-- 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'/>

<!-- PosInt for the first sphere: a square in the XY-plane. -->
<!-- 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'/>

<!-- PosInt for second Sphere:a square in the XY-plane. -->
<!-- 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'/>

<!-- PosInt for the Cylinder: a square in the XY-plane. -->
<!-- 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'/>

<!-- OrientationINT for the Cylinder. -->
<!-- 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'/>

<!-- ScalarInt for cylinder height. -->
<!-- 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'/>

<!-- World clock for all objects. -->

<!-- Routes from clock to first sphere -->
< ROUTE  fromNode=' CLOCK1' fromField='fraction_changed' toNode=' POSINT1' toField='set_fraction'/>
< ROUTE  fromNode=' POSINT1' fromField='value_changed' toNode=' SPHERETF1' toField='set_translation'/>
<!-- Routes from clock to second sphere -->
< ROUTE  fromNode=' CLOCK1' fromField='fraction_changed' toNode=' POSINT2' toField='set_fraction'/>
< ROUTE  fromNode=' POSINT2' fromField='value_changed' toNode=' SPHERETF2' toField='set_translation'/>
<!-- Routes from clock to first sphere -->
< ROUTE  fromNode=' CLOCK1' fromField='fraction_changed' toNode=' ColorINT' toField='set_fraction'/>
< ROUTE  fromNode=' ColorINT' fromField='value_changed' toNode=' SPH_MAT' toField='set_diffuseColor'/>
< ROUTE  fromNode=' ColorINT' fromField='value_changed' toNode=' SPH_MAT' toField='set_emissiveColor'/>
<!-- Routes for Cylinder movement -->
< ROUTE  fromNode=' CLOCK1' fromField='fraction_changed' toNode=' POSINT3' toField='set_fraction'/>
< ROUTE  fromNode=' POSINT3' fromField='value_changed' toNode=' CYL_TF' toField='set_translation'/>
<!-- Routes for Cylinder rotation -->
< ROUTE  fromNode=' CLOCK1' fromField='fraction_changed' toNode=' OrientINT' toField='set_fraction'/>
< ROUTE  fromNode=' OrientINT' fromField='value_changed' toNode=' CYL_TF' toField='set_rotation'/>
<!-- Routes for Cylinder stretching -->
< ROUTE  fromNode=' CLOCK1' fromField='fraction_changed' toNode=' ScalarInt' toField='set_fraction'/>
< ROUTE  fromNode=' ScalarInt' fromField='value_changed' toNode=' CYL_TF' toField='set_scale'/>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: CLOCK1, ColorINT, CYL_TF, CYLSHAPE, OrientINT, POSINT1, POSINT2, POSINT3, ScalarInt, SPH_MAT, SPHERE, SPHERETF1, SPHERETF2

Index for Viewpoint node: Viewpoint_1
-->

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

CLOCK1
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
POSINT1
PositionInterpolator
set_fraction
SFFloat

 
 
then
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
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
ColorINT
ColorInterpolator
value_changed
SFColor

ROUTE
event to
(2)
SPH_MAT
Material
set_diffuseColor
SFColor
 
 
 
then
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
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
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
ScalarInt
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(2)
CYL_TF
Transform
set_scale
SFVec3f


-->

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