| 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='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'> |
| 4 | <head> |
| 5 | <meta name='title' content=' DraggingSphere.x3d '/> |
| 6 | <meta name='description' content='A sphere that drags its tail around a box in the XY-plane'/> |
| 7 | <meta name='creator' content='Matthew Braun'/> |
| 8 | <meta name='created' content='24 July 2001'/> |
| 9 | <meta name='modified' content='20 October 2019'/> |
| 10 | <meta name='rights' content='Copyright (c) Matthew Braun, 2001'/> |
| 11 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/DraggingSphere.x3d '/> |
| 12 | <meta name='generator' content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 13 | <meta name='license' content='../license.html'/> |
| 14 | </head> |
| 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='Start' position='-2 2 7'/> |
| 20 | <!-- The leading sphere --> |
| 21 |
<!-- ROUTE information for SPHERETF1 node:
[from POSINT1.value_changed to set_translation
]
-->
<Transform DEF='SPHERETF1'> |
| 22 | |
| 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_MAT' ambientIntensity='0.9' diffuseColor='.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_TF' rotation='0 0 -1 1.571' scale='1 2 1' translation='-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='ColorINT' key='0 .25 .50 .75 1.0' keyValue='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='POSINT1' key='0 0.08 0.16 0.25 0.33 0.41 0.50 0.58 0.66 0.75 0.83 0.91 1.0' keyValue='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='POSINT2' key='0 0.08 0.16 0.25 0.33 0.41 0.50 0.58 0.66 0.75 0.83 0.91 1.0' keyValue='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='POSINT3' key='0 0.08 0.16 0.25 0.33 0.41 0.50 0.58 0.66 0.75 0.83 0.91 1.0' keyValue='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='OrientINT' key='0.00 0.25 0.25 0.50 0.50 0.75 0.75 1.00' keyValue='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='ScalarInt' key='0 0.08 0.16 0.25 0.33 0.41 0.50 0.58 0.66 0.75 0.83 0.91 1.0' keyValue='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 |
<!-- 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='CLOCK1' cycleInterval='6' loop='true'/> |
| 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 entries 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.
<!--
Color-coding 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)
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->