<?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>
<!--

Index for DEF nodes : Ball, Clock, Coloree, Colorer, Entry, Squishee, Squisher, Stick, Swingee1, Swingee2, Swinger1, Swinger2

Index for Viewpoint image : 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 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='ClockcycleInterval='2.0loop='truestartTime='1.0'/>
<!-- 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='ClockfromField='fraction_changedtoNode='Swinger1toField='set_fraction'/>
<ROUTE fromNode='Swinger1fromField='value_changedtoNode='Swingee1toField='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='ClockfromField='fraction_changedtoNode='Swinger2toField='set_fraction'/>
<ROUTE fromNode='Swinger2fromField='value_changedtoNode='Swingee2toField='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='ClockfromField='fraction_changedtoNode='SquishertoField='set_fraction'/>
<ROUTE fromNode='SquisherfromField='value_changedtoNode='SquisheetoField='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='ClockfromField='fraction_changedtoNode='ColorertoField='set_fraction'/>
<ROUTE fromNode='ColorerfromField='value_changedtoNode='ColoreetoField='set_diffuseColor'/>
</Scene>
</X3D>
<!--

Index for DEF nodes : Ball, Clock, Coloree, Colorer, Entry, Squishee, Squisher, Stick, Swingee1, Swingee2, Swinger1, Swinger2

Index for Viewpoint image : Entry
-->

<!-- 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)
-->

<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources and X3D Scene Authoring Hints. -->