<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://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 =' http://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>
<!--

Index for DEF nodes : CLOCK1, ColorINT, CYL_TF, CYLSHAPE, OrientINT, POSINT1, POSINT2, POSINT3, ScalarInt, SPH_MAT, SPHERE, SPHERETF1, SPHERETF2

Index for Viewpoint image : 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. -->
<!-- ROUTE information for CLOCK1 node:  [from fraction_changed to POSINT1.set_fraction ] [from fraction_changed to POSINT2.set_fraction ] [from fraction_changed to ColorINT.set_fraction ] [from fraction_changed to POSINT3.set_fraction ] [from fraction_changed to OrientINT.set_fraction ] [from fraction_changed to ScalarInt.set_fraction ] -->
<TimeSensor DEF='CLOCK1cycleInterval='6loop='true'/>
<!-- Routes from clock to first sphere -->
<ROUTE fromNode='CLOCK1fromField='fraction_changedtoNode='POSINT1toField='set_fraction'/>
<ROUTE fromNode='POSINT1fromField='value_changedtoNode='SPHERETF1toField='set_translation'/>
<!-- Routes from clock to second sphere -->
<ROUTE fromNode='CLOCK1fromField='fraction_changedtoNode='POSINT2toField='set_fraction'/>
<ROUTE fromNode='POSINT2fromField='value_changedtoNode='SPHERETF2toField='set_translation'/>
<!-- Routes from clock to first sphere -->
<ROUTE fromNode='CLOCK1fromField='fraction_changedtoNode='ColorINTtoField='set_fraction'/>
<ROUTE fromNode='ColorINTfromField='value_changedtoNode='SPH_MATtoField='set_diffuseColor'/>
<ROUTE fromNode='ColorINTfromField='value_changedtoNode='SPH_MATtoField='set_emissiveColor'/>
<!-- Routes for Cylinder movement -->
<ROUTE fromNode='CLOCK1fromField='fraction_changedtoNode='POSINT3toField='set_fraction'/>
<ROUTE fromNode='POSINT3fromField='value_changedtoNode='CYL_TFtoField='set_translation'/>
<!-- Routes for Cylinder rotation -->
<ROUTE fromNode='CLOCK1fromField='fraction_changedtoNode='OrientINTtoField='set_fraction'/>
<ROUTE fromNode='OrientINTfromField='value_changedtoNode='CYL_TFtoField='set_rotation'/>
<!-- Routes for Cylinder stretching -->
<ROUTE fromNode='CLOCK1fromField='fraction_changedtoNode='ScalarInttoField='set_fraction'/>
<ROUTE fromNode='ScalarIntfromField='value_changedtoNode='CYL_TFtoField='set_scale'/>
</Scene>
</X3D>
<!--

Index for DEF nodes : CLOCK1, ColorINT, CYL_TF, CYLSHAPE, OrientINT, POSINT1, POSINT2, POSINT3, ScalarInt, SPH_MAT, SPHERE, SPHERETF1, SPHERETF2

Index for Viewpoint image : Viewpoint_1
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
-->

<!-- Additional help information about X3D scenes: X3D Resources, X3D Scene Authoring Hints and X3D Tooltips -->