<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://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 =' http://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='15 January 2011'/>
<meta name='descriptioncontent='A SpinGroup node type used to automatically spin a group of three boxes. Click on blue crossbar to activate second SpinGroup.'/>
<meta name='identifiercontent=' http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31-Prototypes/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>
<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>
<!-- SpinGroupTransform ROUTE:  [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 -->
<!-- SpinGroupClock ROUTE:  [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>
<!-- Spinner ROUTEs:  [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>
<!-- SecondSpinGroup ROUTE:  [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'>
<!-- ActivateSecondSpinGroup ROUTE:  [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'/>     <Prototype name='ProtoName'> <field name='fieldName'/> </Prototype> -->

<!-- Additional help information about X3D scenes: X3D Resources, X3D Scene Authoring Hints and X3D Tooltips -->