X3D Model Documentation: Squisher.x3d

  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='titlecontent='Squisher.x3d'/>
  6            <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.'/>
  7            <meta name='creatorcontent='David R. Nadeau'/>
  8            <meta name='translatorcontent='Don Brutzman'/>
  9            <meta name='createdcontent='1 July 1998'/>
 10            <meta name='translatedcontent='2 February 2014'/>
 11            <meta name='modifiedcontent='20 October 2019'/>
 12            <meta name='referencecontent='originals/squisher.wrl'/>
 13            <meta name='referencecontent='http://www.siggraph.org/s98'/>
 14            <meta name='referencecontent='http://www.siggraph.org/s98/conference/courses/18.html'/>
 15            <meta name='referencecontent='http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/slides/mt0157.htm'/>
 16            <meta name='referencecontent='http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/vrml97.htm'/>
 17            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/X3dResources.html'/>
 18            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Squisher.x3d'/>
 19            <meta name='generatorcontent='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/>
 20            <meta name='generatorcontent='X3D-Edit, https://savage.nps.edu/X3D-Edit'/>
 21            <meta name='licensecontent='../license.html'/>
 22       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: Ball, Clock, Coloree, Colorer, Entry, Squishee, Squisher, Stick, Swingee1, Swingee2, Swinger1, Swinger2

Index for Viewpoint node: Entry
-->
 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='Entrydescription='Entry viewposition='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 
               <!-- Transform Stick is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
               <Transform DEF='Sticktranslation='0.0 2.0 0.0'>
 39                      <Shape>
 40                           <Appearance>
 41                                <Material/>
 42                           </Appearance>
 43                           <Cylinder height='4.0radius='0.1'/>
 44                      </Shape>
 45                 </Transform>
 46            </Transform>
 47 
          <!-- ROUTE information for Swingee1 node:  [from Swinger1.value_changed to set_rotation ] -->
          <Transform DEF='Swingee1center='0.0 4.0 0.0'>
 48 
               <!-- Shape Ball is a DEF node that has 1 USE node: USE_1 -->
               <Shape DEF='Ball'>
 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='Swingee2center='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='ClockcycleInterval='2.0loop='truestartTime='1.0'/>
 61 
          <!-- 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'/>
 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='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'/>
 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='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'/>
 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='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'/>
 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 shows event connections.
-->

<!-- to top Index for DEF nodes: Ball, Clock, Coloree, Colorer, Entry, Squishee, Squisher, Stick, Swingee1, Swingee2, Swinger1, Swinger2

Index for Viewpoint node: Entry
-->
X3D Tooltips element index: Appearance, Background, ColorInterpolator, Cylinder, head, Material, meta, NavigationInfo, OrientationInterpolator, PositionInterpolator, ROUTE, Scene, Shape, Sphere, TimeSensor, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

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
Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

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