<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Interactive' version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' https://www.web3d.org/specifications/x3d-3.0.xsd '>
<head>
<meta name='titlecontent='Figure09_2SpinningCubeTouchSensorClicked.x3d'/>
<meta name='creatorcontent='Figure 9.2, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/>
<meta name='referencecontent=' http://www.wiley.com/legacy/compbooks/vrml2sbk/ch09/09fig02.htm '/>
<meta name='transcribercontent='Don Brutzman'/>
<meta name='createdcontent='9 August 2000'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='descriptioncontent='A cube that spins when the viewer touches it. Also see Figure 9.1 for comparison.'/>
<meta name='referencecontent='Figure09_1SpinningCubeTouchSensor.x3d'/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter09SensingViewer/Figure09_2SpinningCubeTouchSensorClicked.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!-- -->
<Scene>
<!-- Rotating Cube -->
<WorldInfo title='Figure09_2SpinningCubeTouchSensorClicked.x3d'/>
<Group bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<!-- ROUTE information for CUBE_TRANSFORM node:  [from CubePathInterpolator.value_changed to set_rotation ] -->
<Transform DEF='CUBE_TRANSFORMbboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Shape bboxCenter='0 0 0bboxSize='-1 -1 -1'>
<Box size='2 2 2solid='true'/>
<Appearance>
<Material diffuseColor='.5 .5 .5'/>
</Appearance>
</Shape>
</Transform>
<!-- ROUTE information for MyTouchSensor node:  [from touchTime to CLOCK.set_startTime ] -->
<TouchSensor DEF='MyTouchSensordescription='touch sensor: click to start'/>
<!-- ROUTE information for CLOCK node:  [from MyTouchSensor.touchTime to set_startTime ] [from fraction_changed to CubePathInterpolator.set_fraction ] -->
<TimeSensor DEF='CLOCKcycleInterval='4'/>
<!-- ROUTE information for CubePathInterpolator node:  [from CLOCK.fraction_changed to set_fraction ] [from value_changed to CUBE_TRANSFORM.set_rotation ] -->
<OrientationInterpolator DEF='CubePathInterpolatorkey='0.0 0.50 1.0keyValue='0.0 1.0 0.0 0.0 0.0 1.0 0.0 3.14 0.0 1.0 0.0 6.28'/>
</Group>
<!-- Note that we are connecting a Time output to a Time input in the first ROUTE. -->
<ROUTE fromNode='MyTouchSensorfromField='touchTimetoNode='CLOCKtoField='set_startTime'/>
<ROUTE fromNode='CLOCKfromField='fraction_changedtoNode='CubePathInterpolatortoField='set_fraction'/>
<ROUTE fromNode='CubePathInterpolatorfromField='value_changedtoNode='CUBE_TRANSFORMtoField='set_rotation'/>
</Scene>
</X3D>
<!--

Index for DEF nodes : CLOCK, CUBE_TRANSFORM, CubePathInterpolator, MyTouchSensor
-->

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