<?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_7DonutExternalPrototype.x3d'/>
<meta name='creatorcontent='Figure 31.7, 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/31fig07.htm '/>
<meta name='translatorcontent='Don Brutzman'/>
<meta name='createdcontent='22 November 2000'/>
<meta name='modifiedcontent='16 December 2023'/>
<meta name='descriptioncontent='A donut shape built using prototypes: the Donut geometry node and the LightOak appearance node. Also see Figures 30.5 and 31.6 for comparison.'/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31Prototypes/Figure31_7DonutExternalPrototype.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: Clock, DonutThickness, SpecialtyOfTheHouse, StopSizeChanges

Index for Viewpoint node: Viewpoint_1 Index for ExternProtoDeclare definitions: Donut, LightOak
-->
<Scene>
<WorldInfo title='Figure31_7DonutExternalPrototype.x3d'/>
<ExternProtoDeclare name='Donut'
  url=' "Figure31_6DonutPrototype.wrl#Donut" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31Prototypes/Figure31_6DonutPrototype.wrl#Donut" "Figure31_6DonutPrototype.x3d#Donut" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31Prototypes/Figure31_6DonutPrototype.x3d#Donut" ' >
<field name='crossSectionRadiustype='SFFloataccessType='initializeOnly'/>
<field name='spineRadiustype='SFFloataccessType='initializeOnly'/>
<field name='crossSectionResolutiontype='SFInt32accessType='initializeOnly'/>
<field name='spineResolutiontype='SFInt32accessType='initializeOnly'/>
<field name='set_crossSectionRadiustype='SFFloataccessType='inputOnly'/>
<field name='set_spineRadiustype='SFFloataccessType='inputOnly'/>
</ExternProtoDeclare>
<ExternProtoDeclare name='LightOak'
  url=' "Figure31_4WoodAppearancePrototypesLibrary.wrl#LightOak" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31Prototypes/Figure31_4WoodAppearancePrototypesLibrary.wrl#LightOak" "Figure31_4WoodAppearancePrototypesLibrary.x3d#LightOak" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31Prototypes/Figure31_4WoodAppearancePrototypesLibrary.x3d#LightOak" ' >
<field name='textureTransformtype='SFNodeaccessType='inputOutput'/>
</ExternProtoDeclare>
<Viewpoint description='Click to pick a sizeorientation='1 0 0 -0.52position='0 7 12'/>
<!-- Donut instances from prototypes -->
<Transform translation='0 2 0'>
<Shape>
<ProtoInstance name='DonutcontainerField='geometry'>
<fieldValue name='crossSectionRadiusvalue='1'/>
<fieldValue name='spineRadiusvalue='2'/>
</ProtoInstance>
<ProtoInstance name='LightOakcontainerField='appearance'>
<fieldValue name='textureTransform'>
<TextureTransform center='-0 5rotation='0.758scale='2 0.5translation='0.5 0'/>
</fieldValue>
</ProtoInstance>
</Shape>
</Transform>
<!-- Hmmm, what size donut do you really want? -->
<!-- ROUTE information for Clock node:  [from StopSizeChanges.touchTime to stopTime ] [from fraction_changed to DonutThickness.set_fraction ] -->
<TimeSensor DEF='ClockcycleInterval='10loop='true'/>

<!-- ROUTE information for DonutThickness node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to SpecialtyOfTheHouse.crossSectionRadius ] -->
<ScalarInterpolator DEF='DonutThicknesskey='0 0.4 0.5 0.9 1keyValue='0.75 1.25 1.25 0.75 0.75'/>

<Transform translation='0 -2 0'>
<Shape>
<!-- ROUTE information for SpecialtyOfTheHouse node:  [from DonutThickness.value_changed to crossSectionRadius ] -->
<ProtoInstance name='DonutDEF='SpecialtyOfTheHousecontainerField='geometry'>
<fieldValue name='crossSectionRadiusvalue='0.5'/>
<fieldValue name='spineRadiusvalue='2'/>
</ProtoInstance>
<Appearance> </Appearance>
</Shape>
<!-- ROUTE information for StopSizeChanges node:  [from touchTime to Clock.stopTime ] -->
<TouchSensor DEF='StopSizeChangesdescription='touch to stop size changes'/>
</Transform>
< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' DonutThickness' toField='set_fraction'/>
< ROUTE  fromNode=' DonutThickness' fromField='value_changed' toNode=' SpecialtyOfTheHouse' toField='crossSectionRadius'/>
< ROUTE  fromNode=' StopSizeChanges' fromField='touchTime' toNode=' Clock' toField='stopTime'/>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: Clock, DonutThickness, SpecialtyOfTheHouse, StopSizeChanges

Index for Viewpoint node: Viewpoint_1 Index for ExternProtoDeclare definitions: Donut, LightOak
-->

Event Graph ROUTE Table entries with 3 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.

StopSizeChanges
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
Clock
TimeSensor
stopTime
SFTime

 
 
then
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
DonutThickness
ScalarInterpolator
set_fraction
SFFloat

 
 
then
DonutThickness
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(3)
SpecialtyOfTheHouse
ProtoInstance
crossSectionRadius
SFFloat


Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
DonutThickness
ScalarInterpolator
set_fraction
SFFloat

 
 
then
DonutThickness
ScalarInterpolator
value_changed
SFFloat

ROUTE
event to
(2)
SpecialtyOfTheHouse
ProtoInstance
crossSectionRadius
SFFloat



ProtoInstance
Donut
No ROUTE connection found for output from this node.
Contains SFNode/MFNode field with indirect access to other nodes. 



ProtoInstance
LightOak
No ROUTE connection found for output from this node.
Contains SFNode/MFNode field with indirect access to other nodes. 


      SpecialtyOfTheHouse
ProtoInstance
Donut
No ROUTE connection found for output from this node.
Contains SFNode/MFNode field with indirect access to other nodes. 


-->

<!-- Online at
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31Prototypes/Figure31_7DonutExternalPrototypeIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31Prototypes/Figure31_7DonutExternalPrototype.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)
    <ProtoInstance name='ProtoName'> <field name='fieldName'/> </ProtoInstance> -->

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