<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<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 ' >
<head>
<meta name='titlecontent='Squisher.x3d'/>
<meta name='descriptioncontent='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.'/>
<meta name='creatorcontent='David R. Nadeau'/>
<meta name='translatorcontent='Don Brutzman'/>
<meta name='createdcontent='1 July 1998'/>
<meta name='translatedcontent='2 February 2014'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='referencecontent='originals/squisher.wrl'/>
<meta name='referencecontent=' http://www.siggraph.org/s98 '/>
<meta name='referencecontent=' http://www.siggraph.org/s98/conference/courses/18.html '/>
<meta name='referencecontent=' http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/slides/mt0157.htm '/>
<meta name='referencecontent=' http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/vrml97.htm '/>
<meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/X3dResources.html '/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Squisher.x3d '/>
<meta name='generatorcontent='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/>
<meta name='generatorcontent='X3D-Edit, 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: Ball, Clock, Coloree, Colorer, Entry, Squishee, Squisher, Stick, Swingee1, Swingee2, Swinger1, Swinger2

Index for Viewpoint node: Entry
-->
<Scene>
<!-- 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. -->
<WorldInfo info='"Copyright (c) 1997, David R. Nadeau"title='Squishy ball'/>
<Viewpoint DEF='Entrydescription='Entry viewposition='0.0 1.6 10.0'/>
<NavigationInfo/>
<Background/>
<Transform center='0.0 4.0 0.0'>
<!-- ROUTE information for Squishee node:  [from Squisher.value_changed to set_scale ] -->
<Transform DEF='Squishee'>
<Shape>
<Appearance>
<!-- ROUTE information for Coloree node:  [from Colorer.value_changed to set_diffuseColor ] -->
<Material DEF='Coloree'/>
</Appearance>
<Sphere/>
</Shape>
</Transform>
<Transform DEF='Sticktranslation='0.0 2.0 0.0'>
<Shape>
<Appearance>
<Material/>
</Appearance>
<Cylinder height='4.0radius='0.1'/>
</Shape>
</Transform>
</Transform>
<!-- ROUTE information for Swingee1 node:  [from Swinger1.value_changed to set_rotation ] -->
<Transform DEF='Swingee1center='0.0 4.0 0.0'>
<Shape DEF='Ball'>
<Appearance>
<Material diffuseColor='0.0 0.5 1.0'/>
</Appearance>
<Sphere/>
</Shape>
<Transform USE=' Stick'/>
</Transform>
<!-- ROUTE information for Swingee2 node:  [from Swinger2.value_changed to set_rotation ] -->
<Transform DEF='Swingee2center='0.0 4.0 0.0'>
<Shape USE=' Ball'/>
<Transform USE=' Stick'/>
</Transform>

<!-- ROUTE information for Swinger1 node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to Swingee1.set_rotation ] -->
<OrientationInterpolator DEF='Swinger1key='0.0 0.5 1.0keyValue='0.0 0.0 1.0 -0.5 0.0 0.0 1.0 -0.2 0.0 0.0 1.0 -0.5'/>

< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' Swinger1' toField='set_fraction'/>
< ROUTE  fromNode=' Swinger1' fromField='value_changed' toNode=' Swingee1' toField='set_rotation'/>
<!-- ROUTE information for Swinger2 node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to Swingee2.set_rotation ] -->
<OrientationInterpolator DEF='Swinger2key='0.0 0.5 1.0keyValue='0.0 0.0 1.0 0.5 0.0 0.0 1.0 0.2 0.0 0.0 1.0 0.5'/>

< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' Swinger2' toField='set_fraction'/>
< ROUTE  fromNode=' Swinger2' fromField='value_changed' toNode=' Swingee2' toField='set_rotation'/>
<!-- ROUTE information for Squisher node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to Squishee.set_scale ] -->
<PositionInterpolator DEF='Squisherkey='0.0 0.5 1.0keyValue='1.0 1.0 1.0 0.5 1.4 1.4 1.0 1.0 1.0'/>

< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' Squisher' toField='set_fraction'/>
< ROUTE  fromNode=' Squisher' fromField='value_changed' toNode=' Squishee' toField='set_scale'/>
<!-- ROUTE information for Colorer node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to Coloree.set_diffuseColor ] -->
<ColorInterpolator DEF='Colorerkey='0.0 0.5 1.0keyValue='0.0 0.5 1.0 1.0 0.0 0.0 0.0 0.5 1.0'/>

< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' Colorer' toField='set_fraction'/>
< ROUTE  fromNode=' Colorer' fromField='value_changed' toNode=' Coloree' toField='set_diffuseColor'/>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: Ball, Clock, Coloree, Colorer, Entry, Squishee, Squisher, Stick, Swingee1, Swingee2, Swinger1, Swinger2

Index for Viewpoint node: Entry
-->

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

ROUTE
event to
(1)
Swinger1
OrientationInterpolator
set_fraction
SFFloat

 
 
then
Swinger1
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(2)
Swingee1
Transform
set_rotation
SFRotation
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
Swinger2
OrientationInterpolator
set_fraction
SFFloat

 
 
then
Swinger2
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(2)
Swingee2
Transform
set_rotation
SFRotation
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
Squisher
PositionInterpolator
set_fraction
SFFloat

 
 
then
Squisher
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(2)
Squishee
Transform
set_scale
SFVec3f
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
Colorer
ColorInterpolator
set_fraction
SFFloat

 
 
then
Colorer
ColorInterpolator
value_changed
SFColor

ROUTE
event to
(2)
Coloree
Material
set_diffuseColor
SFColor


-->

<!-- Online at
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/SquisherIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Squisher.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. -->