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='Interchange' 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='title' content='Squisher.x3d'/> |
6 | <meta name='description' content='Squishy ball world illustrates the use of orientation, color, and position interpolators. The world contains left, center, and right balls. The left and right balls swing back and forth, pivoting about a common point above the center ball. Each time the left and right balls swing inward, striking the center ball, the center ball squishes and turns red.'/> |
7 | <meta name='creator' content='David R. Nadeau'/> |
8 | <meta name='translator' content='Don Brutzman'/> |
9 | <meta name='created' content='1 July 1998'/> |
10 | <meta name='translated' content='2 February 2014'/> |
11 | <meta name='modified' content='20 October 2019'/> |
12 | <meta name='reference' content='originals/squisher.wrl'/> |
13 | <meta name='reference' content='http://www.siggraph.org/s98'/> |
14 | <meta name='reference' content='http://www.siggraph.org/s98/conference/courses/18.html'/> |
15 | <meta name='reference' content='http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/slides/mt0157.htm'/> |
16 | <meta name='reference' content='http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/vrml97.htm'/> |
17 | <meta name='reference' content='https://www.web3d.org/x3d/content/examples/X3dResources.html'/> |
18 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Squisher.x3d'/> |
19 | <meta name='generator' content='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/> |
20 | <meta name='generator' content='X3D-Edit, https://savage.nps.edu/X3D-Edit'/> |
21 | <meta name='license' content='../license.html'/> |
22 | </head> |
23 | <Scene> |
24 | <!-- To make this effect, two orientation interpolators swing the left and right balls back and forth. A position interpolator's output is used as a scale value to squish the center ball. Finally, a color interpolator repeatedly turns the center ball red, then blue. --> |
25 | <WorldInfo info='"Copyright (c) 1997, David R. Nadeau"' title='Squishy ball'/> |
26 | <Viewpoint DEF='Entry' description='Entry view' position='0.0 1.6 10.0'/> |
27 | <NavigationInfo/> |
28 | <Background/> |
29 | <Transform center='0.0 4.0 0.0'> |
30 |
<!-- ROUTE information for Squishee node:
[from Squisher.value_changed to set_scale
]
-->
<Transform DEF='Squishee'> |
31 | <Shape> |
32 | <Appearance> |
33 |
<!-- ROUTE information for Coloree node:
[from Colorer.value_changed to set_diffuseColor
]
-->
<Material DEF='Coloree'/> |
34 | </Appearance> |
35 | <Sphere/> |
36 | </Shape> |
37 | </Transform> |
38 | |
39 | <Shape> |
40 | <Appearance> |
41 | <Material/> |
42 | </Appearance> |
43 | <Cylinder height='4.0' radius='0.1'/> |
44 | </Shape> |
45 | </Transform> |
46 | </Transform> |
47 |
<!-- ROUTE information for Swingee1 node:
[from Swinger1.value_changed to set_rotation
]
-->
<Transform DEF='Swingee1' center='0.0 4.0 0.0'> |
48 | |
49 | <Appearance> |
50 | <Material diffuseColor='0.0 0.5 1.0'/> |
51 | </Appearance> |
52 | <Sphere/> |
53 | </Shape> |
54 | <Transform USE='Stick'/> |
55 | </Transform> |
56 |
<!-- ROUTE information for Swingee2 node:
[from Swinger2.value_changed to set_rotation
]
-->
<Transform DEF='Swingee2' center='0.0 4.0 0.0'> |
57 | <Shape USE='Ball'/> |
58 | <Transform USE='Stick'/> |
59 | </Transform> |
60 |
<!-- ROUTE information for Clock node:
[from fraction_changed to Swinger1.set_fraction
]
[from fraction_changed to Swinger2.set_fraction
]
[from fraction_changed to Squisher.set_fraction
]
[from fraction_changed to Colorer.set_fraction
]
-->
<TimeSensor DEF='Clock' cycleInterval='2.0' loop='true' startTime='1.0'/> |
61 |
<!-- ROUTE information for Swinger1 node:
[from Clock.fraction_changed to set_fraction
]
[from value_changed to Swingee1.set_rotation
]
-->
<OrientationInterpolator DEF='Swinger1' key='0.0 0.5 1.0' keyValue='0.0 0.0 1.0 -0.5 0.0 0.0 1.0 -0.2 0.0 0.0 1.0 -0.5'/> |
62 | < ROUTE fromNode='Clock' fromField='fraction_changed' toNode='Swinger1' toField='set_fraction'/> |
63 | < ROUTE fromNode='Swinger1' fromField='value_changed' toNode='Swingee1' toField='set_rotation'/> |
64 |
<!-- ROUTE information for Swinger2 node:
[from Clock.fraction_changed to set_fraction
]
[from value_changed to Swingee2.set_rotation
]
-->
<OrientationInterpolator DEF='Swinger2' key='0.0 0.5 1.0' keyValue='0.0 0.0 1.0 0.5 0.0 0.0 1.0 0.2 0.0 0.0 1.0 0.5'/> |
65 | < ROUTE fromNode='Clock' fromField='fraction_changed' toNode='Swinger2' toField='set_fraction'/> |
66 | < ROUTE fromNode='Swinger2' fromField='value_changed' toNode='Swingee2' toField='set_rotation'/> |
67 |
<!-- ROUTE information for Squisher node:
[from Clock.fraction_changed to set_fraction
]
[from value_changed to Squishee.set_scale
]
-->
<PositionInterpolator DEF='Squisher' key='0.0 0.5 1.0' keyValue='1.0 1.0 1.0 0.5 1.4 1.4 1.0 1.0 1.0'/> |
68 | < ROUTE fromNode='Clock' fromField='fraction_changed' toNode='Squisher' toField='set_fraction'/> |
69 | < ROUTE fromNode='Squisher' fromField='value_changed' toNode='Squishee' toField='set_scale'/> |
70 |
<!-- ROUTE information for Colorer node:
[from Clock.fraction_changed to set_fraction
]
[from value_changed to Coloree.set_diffuseColor
]
-->
<ColorInterpolator DEF='Colorer' key='0.0 0.5 1.0' keyValue='0.0 0.5 1.0 1.0 0.0 0.0 0.0 0.5 1.0'/> |
71 | < ROUTE fromNode='Clock' fromField='fraction_changed' toNode='Colorer' toField='set_fraction'/> |
72 | < ROUTE fromNode='Colorer' fromField='value_changed' toNode='Coloree' toField='set_diffuseColor'/> |
73 | </Scene> |
74 | </X3D> |
Event Graph ROUTE Table with 8 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.
Clock
TimeSensor fraction_changed SFFloat |
Swinger1
OrientationInterpolator set_fraction SFFloat |
then
|
Swinger1
OrientationInterpolator value_changed SFRotation |
Swingee1
Transform set_rotation SFRotation |
||
Clock
TimeSensor fraction_changed SFFloat |
Swinger2
OrientationInterpolator set_fraction SFFloat |
then
|
Swinger2
OrientationInterpolator value_changed SFRotation |
Swingee2
Transform set_rotation SFRotation |
||
Clock
TimeSensor fraction_changed SFFloat |
Squisher
PositionInterpolator set_fraction SFFloat |
then
|
Squisher
PositionInterpolator value_changed SFVec3f |
Squishee
Transform set_scale SFVec3f |
||
Clock
TimeSensor fraction_changed SFFloat |
Colorer
ColorInterpolator set_fraction SFFloat |
then
|
Colorer
ColorInterpolator value_changed SFColor |
Coloree
Material set_diffuseColor SFColor |
<!--
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)
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->