| 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='title' content=' Figure31_7DonutExternalPrototype.x3d '/> |
| 6 | <meta name='creator' content='Figure 31.7, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/> |
| 7 | <meta name='reference' content=' http://www.wiley.com/legacy/compbooks/vrml2sbk/ch31/31fig07.htm '/> |
| 8 | <meta name='translator' content='Don Brutzman'/> |
| 9 | <meta name='created' content='22 November 2000'/> |
| 10 | <meta name='modified' content='16 December 2023'/> |
| 11 | <meta name='description' content='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='identifier' content=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31Prototypes/Figure31_7DonutExternalPrototype.x3d '/> |
| 13 | <meta name='generator' content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 14 | <meta name='license' content='../../license.html'/> |
| 15 | </head> |
| 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='crossSectionRadius' type='SFFloat' accessType='initializeOnly'/> |
| 20 | <field name='spineRadius' type='SFFloat' accessType='initializeOnly'/> |
| 21 | <field name='crossSectionResolution' type='SFInt32' accessType='initializeOnly'/> |
| 22 | <field name='spineResolution' type='SFInt32' accessType='initializeOnly'/> |
| 23 | <field name='set_crossSectionRadius' type='SFFloat' accessType='inputOnly'/> |
| 24 | <field name='set_spineRadius' type='SFFloat' accessType='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='textureTransform' type='SFNode' accessType='inputOutput'/> |
| 28 | </ExternProtoDeclare> |
| 29 | <Viewpoint description='Click to pick a size' orientation='1 0 0 -0.52' position='0 7 12'/> |
| 30 | <!-- Donut instances from prototypes --> |
| 31 | <Transform translation='0 2 0'> |
| 32 | <Shape> |
| 33 | <ProtoInstance name='Donut' containerField='geometry'> |
| 34 | <fieldValue name='crossSectionRadius' value='1'/> |
| 35 | <fieldValue name='spineRadius' value='2'/> |
| 36 | </ProtoInstance> |
| 37 | <ProtoInstance name='LightOak' containerField='appearance'> |
| 38 | <fieldValue name='textureTransform'> |
| 39 | <TextureTransform center='-0 5' rotation='0.758' scale='2 0.5' translation='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='Clock' cycleInterval='10' loop='true'/> |
| 46 |
<!-- ROUTE information for DonutThickness node:
[from Clock.fraction_changed to set_fraction
]
[from value_changed to SpecialtyOfTheHouse.crossSectionRadius
]
-->
<ScalarInterpolator DEF='DonutThickness' key='0 0.4 0.5 0.9 1' keyValue='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='Donut' DEF='SpecialtyOfTheHouse' containerField='geometry'> |
| 50 | <fieldValue name='crossSectionRadius' value='0.5'/> |
| 51 | <fieldValue name='spineRadius' value='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='StopSizeChanges' description='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 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 |
Clock
TimeSensor stopTime SFTime |
then
|
Clock
TimeSensor fraction_changed SFFloat |
DonutThickness
ScalarInterpolator set_fraction SFFloat |
then
|
DonutThickness
ScalarInterpolator value_changed SFFloat |
SpecialtyOfTheHouse
ProtoInstance crossSectionRadius SFFloat |
| line 33
ProtoInstance Donut |
No direct ROUTE connection found for events to/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. |
| line 37
ProtoInstance LightOak |
No direct ROUTE connection found for events to/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. |
|
SpecialtyOfTheHouse
ProtoInstance Donut |
No direct ROUTE connection found for events to/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. |
<!--
Color-coding 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>
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->