X3D Model Documentation: Figure31_7DonutExternalPrototype.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2 
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
  3  <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'>
  4       <head>
  5            <meta name='titlecontent='Figure31_7DonutExternalPrototype.x3d'/>
  6            <meta name='creatorcontent='Figure 31.7, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/>
  7            <meta name='referencecontent='http://www.wiley.com/legacy/compbooks/vrml2sbk/ch31/31fig07.htm'/>
  8            <meta name='translatorcontent='Don Brutzman'/>
  9            <meta name='createdcontent='22 November 2000'/>
 10            <meta name='modifiedcontent='16 December 2023'/>
 11            <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.'/>
 12            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31Prototypes/Figure31_7DonutExternalPrototype.x3d'/>
 13            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 14            <meta name='licensecontent='../../license.html'/>
 15       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: Clock, DonutThickness, SpecialtyOfTheHouse, StopSizeChanges

Index for Viewpoint node: Viewpoint_1

Index for ExternProtoDeclare definitions: Donut, LightOak
-->
 16       <Scene>
 17            <WorldInfo title='Figure31_7DonutExternalPrototype.x3d'/>
 18            <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" '>
 19                 <field name='crossSectionRadiustype='SFFloataccessType='initializeOnly'/>
 20                 <field name='spineRadiustype='SFFloataccessType='initializeOnly'/>
 21                 <field name='crossSectionResolutiontype='SFInt32accessType='initializeOnly'/>
 22                 <field name='spineResolutiontype='SFInt32accessType='initializeOnly'/>
 23                 <field name='set_crossSectionRadiustype='SFFloataccessType='inputOnly'/>
 24                 <field name='set_spineRadiustype='SFFloataccessType='inputOnly'/>
 25            </ExternProtoDeclare>
 26            <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" '>
 27                 <field name='textureTransformtype='SFNodeaccessType='inputOutput'/>
 28            </ExternProtoDeclare>
 29            <Viewpoint description='Click to pick a sizeorientation='1 0 0 -0.52position='0 7 12'/>
 30            <!-- Donut instances from prototypes -->
 31            <Transform translation='0 2 0'>
 32                 <Shape>
 33                      <ProtoInstance name='DonutcontainerField='geometry'>
 34                           <fieldValue name='crossSectionRadiusvalue='1'/>
 35                           <fieldValue name='spineRadiusvalue='2'/>
 36                      </ProtoInstance>
 37                      <ProtoInstance name='LightOakcontainerField='appearance'>
 38                           <fieldValue name='textureTransform'>
 39                                <TextureTransform center='-0 5rotation='0.758scale='2 0.5translation='0.5 0'/>
 40                           </fieldValue>
 41                      </ProtoInstance>
 42                 </Shape>
 43            </Transform>
 44            <!-- Hmmm, what size donut do you really want? -->
 45 
          <!-- ROUTE information for Clock node:  [from StopSizeChanges.touchTime to stopTime ] [from fraction_changed to DonutThickness.set_fraction ] -->
          <TimeSensor DEF='ClockcycleInterval='10loop='true'/>
 46 
          <!-- 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'/>
 47            <Transform translation='0 -2 0'>
 48                 <Shape>
 49 
                    <!-- ROUTE information for SpecialtyOfTheHouse node:  [from DonutThickness.value_changed to crossSectionRadius ] -->
                    <ProtoInstance name='DonutDEF='SpecialtyOfTheHousecontainerField='geometry'>
 50                           <fieldValue name='crossSectionRadiusvalue='0.5'/>
 51                           <fieldValue name='spineRadiusvalue='2'/>
 52                      </ProtoInstance>
 53                      <Appearance>
 54                           <ImageTexture   url=' "../Chapter17Textures/icing.jpg " "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter17Textures/icing.jpg " '/>
 55                      </Appearance>
 56                 </Shape>
 57 
               <!-- ROUTE information for StopSizeChanges node:  [from touchTime to Clock.stopTime ] -->
               <TouchSensor DEF='StopSizeChangesdescription='touch to stop size changes'/>
 58            </Transform>
 59            < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='DonutThickness' toField='set_fraction'/>
 60            < ROUTE  fromNode='DonutThickness' fromField='value_changed' toNode='SpecialtyOfTheHouse' toField='crossSectionRadius'/>
 61            < ROUTE  fromNode='StopSizeChanges' fromField='touchTime' toNode='Clock' toField='stopTime'/>
 62       </Scene>
 63  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: Clock, DonutThickness, SpecialtyOfTheHouse, StopSizeChanges

Index for Viewpoint node: Viewpoint_1

Index for ExternProtoDeclare definitions: Donut, LightOak
-->
X3D Tooltips element index: Appearance, ExternProtoDeclare, field, fieldValue, head, ImageTexture, meta, ProtoInstance, ROUTE, ScalarInterpolator, Scene, Shape, TextureTransform, TimeSensor, TouchSensor, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

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


ProtoInstance
Donut
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 


ProtoInstance
LightOak
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declaration with
direct access to other nodes, and thus has potential to produce run-time animation. 

Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

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