<?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 content='Figure31.7DonutExternalPrototype.x3d' name='title'/>
    <meta content='Figure 31.7, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland' name='creator'/>
    <meta content='http://www.wiley.com/legacy/compbooks/vrml2sbk/ch31/31fig07.htm' name='reference'/>
    <meta content='Don Brutzman' name='translator'/>
    <meta content='22 November 2000' name='created'/>
    <meta content='25 March 2012' name='modified'/>
    <meta content='A donut shape built using the Donut geometry node and the LightOak appearance node. Also see Figures 30.5 and 31.6 for comparison.' name='description'/>
    <meta content='http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31-Prototypes/Figure31.7DonutExternalPrototype.x3d' name='identifier'/>
    <meta content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit' name='generator'/>
    <meta content='../../license.html' name='license'/>
  </head>
  <Scene>
    <ExternProtoDeclare name='Donut' url='"Figure31.6DonutPrototype.wrl#Donut" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31-Prototypes/Figure31.6DonutPrototype.wrl#Donut" "Figure31.6DonutPrototype.x3d#Donut" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31-Prototypes/Figure31.6DonutPrototype.x3d#Donut"'>
      <field accessType='initializeOnly' name='crossSectionRadius' type='SFFloat'/>
      <field accessType='initializeOnly' name='spineRadius' type='SFFloat'/>
      <field accessType='initializeOnly' name='crossSectionResolution' type='SFInt32'/>
      <field accessType='initializeOnly' name='spineResolution' type='SFInt32'/>
      <field accessType='inputOnly' name='set_crossSectionRadius' type='SFFloat'/>
      <field accessType='inputOnly' name='set_spineRadius' type='SFFloat'/>
    </ExternProtoDeclare>
    <ExternProtoDeclare name='LightOak' url='"Figure31.4WoodAppearancePrototypesLibrary.wrl#LightOak" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31-Prototypes/Figure31.4WoodAppearancePrototypesLibrary.wrl#LightOak" "Figure31.4WoodAppearancePrototypesLibrary.x3d#LightOak" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31-Prototypes/Figure31.4WoodAppearancePrototypesLibrary.x3d#LightOak"'>
      <field accessType='inputOutput' name='textureTransform' type='SFNode'/>
    </ExternProtoDeclare>
    <Viewpoint description='Click to pick a size' orientation='1 0 0 -0.52' position='0 7 12'/>
    <!-- Donut instances from prototypes -->
    <Transform translation='0 2 0'>
      <Shape>
        <ProtoInstance containerField='geometry' name='Donut'>
          <fieldValue name='crossSectionRadius' value='1'/>
          <fieldValue name='spineRadius' value='2'/>
        </ProtoInstance>
        <ProtoInstance containerField='appearance' name='LightOak'>
          <fieldValue name='textureTransform'>
            <TextureTransform center='-0 5' rotation='0.758' scale='2 0.5' translation='0.5 0'/>
          </fieldValue>
        </ProtoInstance>
      </Shape>
    </Transform>
    <!-- Hmmm, what size donut do you really want? -->
    <TimeSensor DEF='Clock' cycleInterval='10' loop='true'/>
    <ScalarInterpolator DEF='DonutThickness' key='0 0.4 0.5 0.9 1' keyValue='0.75 1.25 1.25 0.75 0.75'/>
    <Transform translation='0 -2 0'>
      <Shape>
        <ProtoInstance DEF='SpecialtyOfTheHouse' containerField='geometry' name='Donut'>
          <fieldValue name='crossSectionRadius' value='0.5'/>
          <fieldValue name='spineRadius' value='2'/>
        </ProtoInstance>
        <Appearance>
          <ImageTexture url='"../Chapter17-Textures/icing.jpg" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter17-Textures/icing.jpg"'/>
        </Appearance>
      </Shape>
      <TouchSensor DEF='StopSizeChanges' description='touch to stop size changes'/>
    </Transform>
    <ROUTE fromField='fraction_changed' fromNode='Clock' toField='set_fraction' toNode='DonutThickness'/>
    <ROUTE fromField='value_changed' fromNode='DonutThickness' toField='set_crossSectionRadius' toNode='SpecialtyOfTheHouse'/>
    <ROUTE fromField='touchTime' fromNode='StopSizeChanges' toField='stopTime' toNode='Clock'/>
  </Scene>
</X3D>