<?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='Immersive' 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='Figure31_9SpinGroupPrototype.x3d'/>
<meta name='creatorcontent='Figure 31.9, 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/ch31/31fig09.htm '/>
<meta name='translatorcontent='Don Brutzman'/>
<meta name='createdcontent='24 October 2000'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='descriptioncontent='The SpinGroup prototype is used to automatically spin a group of three long rectangular boxes. Click on blue crossbar to activate second SpinGroup.'/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31Prototypes/Figure31_9SpinGroupPrototype.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!--

Index for ProtoDeclare definition : SpinGroup

Index for DEF nodes : ActivateSecondSpinGroup, Green, SecondSpinGroup, SpinGroupClock, SpinGroupTransform, Spinner

Index for Viewpoint image : Viewpoint_1
-->
<Scene>
<WorldInfo title='Figure31_9SpinGroupPrototype.x3d'/>
<ProtoDeclare name='SpinGroup'>
<ProtoInterface>
<field name='childrentype='MFNodeaccessType='inputOutput'>
<!-- NULL node initialization -->
</field>
<field name='cycleIntervaltype='SFTimevalue='1accessType='inputOutput'/>
<field name='looptype='SFBoolvalue='falseaccessType='inputOutput'/>
<field name='startTimetype='SFTimevalue='0accessType='inputOutput'/>
<field name='stopTimetype='SFTimevalue='0accessType='inputOutput'/>
</ProtoInterface>
<ProtoBody>
<!-- ROUTE information for SpinGroupTransform node:  [from Spinner.value_changed to set_rotation ] -->
<Transform DEF='SpinGroupTransform'>
<IS>
<connect nodeField='childrenprotoField='children'/>
</IS>
</Transform>
<!-- following nodes will not be rendered, only the first node of a ProtoBody is drawn -->
<!-- ROUTE information for SpinGroupClock node:  [from fraction_changed to Spinner.set_fraction ] -->
<TimeSensor DEF='SpinGroupClock'>
<IS>
<connect nodeField='cycleIntervalprotoField='cycleInterval'/>
<connect nodeField='loopprotoField='loop'/>
<connect nodeField='startTimeprotoField='startTime'/>
<connect nodeField='stopTimeprotoField='stopTime'/>
</IS>
</TimeSensor>
<!-- ROUTE information for Spinner node:  [from SpinGroupClock.fraction_changed to set_fraction ] [from value_changed to SpinGroupTransform.set_rotation ] -->
<OrientationInterpolator DEF='Spinnerkey='0 0.5 1keyValue='0 1 0 0 0 1 0 3.14 0 1 0 6.28'/>
<ROUTE fromNode='SpinGroupClockfromField='fraction_changedtoNode='SpinnertoField='set_fraction'/>
<ROUTE fromNode='SpinnerfromField='value_changedtoNode='SpinGroupTransformtoField='set_rotation'/>
</ProtoBody>
</ProtoDeclare>
<!-- Now the scene proper begins. Nothing renders in a ProtoDeclare (or ExternProtoDeclare). -->
<Viewpoint description='Click on blue crossbar to activate second SpinGrouporientation='1 0 0 -0.52position='0 18 30'/>
<!-- Create an instance, meaning actual nodes that render -->
<ProtoInstance name='SpinGroup'>
<fieldValue name='cycleIntervalvalue='8'/>
<fieldValue name='loopvalue='true'/>
<fieldValue name='children'>
<Shape>
<Box size='25 2 2'/>
<Appearance DEF='Green'>
<Material diffuseColor='0 1 0.3'/>
</Appearance>
</Shape>
<Shape>
<Box size='2 25 2'/>
<Appearance USE='Green'/>
</Shape>
<!-- ROUTE information for SecondSpinGroup node:  [from ActivateSecondSpinGroup.touchTime to startTime ] -->
<ProtoInstance name='SpinGroupDEF='SecondSpinGroup'>
<fieldValue name='cycleIntervalvalue='4'/>
<fieldValue name='loopvalue='true'/>
<!-- stopTime > startTime ensures that initial state is stopped -->
<fieldValue name='stopTimevalue='1'/>
<fieldValue name='children'>
<!-- ROUTE information for ActivateSecondSpinGroup node:  [from touchTime to SecondSpinGroup.startTime ] -->
<TouchSensor DEF='ActivateSecondSpinGroupdescription='Activate second SpinGroup by clicking blue bar'/>
<Shape>
<Box size='2 2.05 25'/>
<Appearance>
<Material diffuseColor='0 0.3 1'/>
</Appearance>
</Shape>
</fieldValue>
</ProtoInstance>
</fieldValue>
</ProtoInstance>
<ROUTE fromNode='ActivateSecondSpinGroupfromField='touchTimetoNode='SecondSpinGrouptoField='startTime'/>
</Scene>
</X3D>
<!--

Index for ProtoDeclare definition : SpinGroup

Index for DEF nodes : ActivateSecondSpinGroup, Green, SecondSpinGroup, SpinGroupClock, SpinGroupTransform, Spinner

Index for Viewpoint image : Viewpoint_1
-->

<!-- 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)
    <Prototype name='ProtoName'> <field name='fieldName'/> </Prototype> -->

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