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_9SpinGroupPrototype.x3d'/> |
6 | <meta name='creator' content='Figure 31.9, 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/31fig09.htm'/> |
8 | <meta name='translator' content='Don Brutzman'/> |
9 | <meta name='created' content='24 October 2000'/> |
10 | <meta name='modified' content='20 October 2019'/> |
11 | <meta name='description' content='The SpinGroup prototype is used to automatically spin a group of three long rectangular boxes. Click on blue crossbar to activate second SpinGroup.'/> |
12 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31Prototypes/Figure31_9SpinGroupPrototype.x3d'/> |
13 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
14 | <meta name='license' content='../../license.html'/> |
15 | </head> |
16 | <Scene> |
17 | <WorldInfo title='Figure31_9SpinGroupPrototype.x3d'/> |
18 | <ProtoDeclare name='SpinGroup'> |
19 | <ProtoInterface> |
20 | <field name='children' type='MFNode' accessType='inputOutput'> |
21 | <!-- NULL node initialization --> |
22 | </field> |
23 | <field name='cycleInterval' type='SFTime' value='1' accessType='inputOutput'/> |
24 | <field name='loop' type='SFBool' value='false' accessType='inputOutput'/> |
25 | <field name='startTime' type='SFTime' value='0' accessType='inputOutput'/> |
26 | <field name='stopTime' type='SFTime' value='0' accessType='inputOutput'/> |
27 | </ProtoInterface> |
28 | <ProtoBody> |
29 |
<!-- ROUTE information for SpinGroupTransform node:
[from Spinner.value_changed to set_rotation
]
-->
<Transform DEF='SpinGroupTransform'> |
30 | <IS> |
31 | <connect nodeField='children' protoField='children'/> |
32 | </IS> |
33 | </Transform> |
34 | <!-- following nodes will not be rendered, only the first node of a ProtoBody is drawn --> |
35 |
<!-- ROUTE information for SpinGroupClock node:
[from fraction_changed to Spinner.set_fraction
]
-->
<TimeSensor DEF='SpinGroupClock'> |
36 | <IS> |
37 | <connect nodeField='cycleInterval' protoField='cycleInterval'/> |
38 | <connect nodeField='loop' protoField='loop'/> |
39 | <connect nodeField='startTime' protoField='startTime'/> |
40 | <connect nodeField='stopTime' protoField='stopTime'/> |
41 | </IS> |
42 | </TimeSensor> |
43 |
<!-- ROUTE information for Spinner node:
[from SpinGroupClock.fraction_changed to set_fraction
]
[from value_changed to SpinGroupTransform.set_rotation
]
-->
<OrientationInterpolator DEF='Spinner' key='0 0.5 1' keyValue='0 1 0 0 0 1 0 3.14 0 1 0 6.28'/> |
44 | < ROUTE fromNode='SpinGroupClock' fromField='fraction_changed' toNode='Spinner' toField='set_fraction'/> |
45 | < ROUTE fromNode='Spinner' fromField='value_changed' toNode='SpinGroupTransform' toField='set_rotation'/> |
46 | </ProtoBody> |
47 | </ProtoDeclare> |
48 | <!-- Now the scene proper begins. Nothing renders in a ProtoDeclare (or ExternProtoDeclare). --> |
49 | <Viewpoint description='Click on blue crossbar to activate second SpinGroup' orientation='1 0 0 -0.52' position='0 18 30'/> |
50 | <!-- Create an instance, meaning actual nodes that render --> |
51 | <ProtoInstance name='SpinGroup'> |
52 | <fieldValue name='cycleInterval' value='8'/> |
53 | <fieldValue name='loop' value='true'/> |
54 | <fieldValue name='children'> |
55 | <Shape> |
56 | <Box size='25 2 2'/> |
57 | |
58 | <Material diffuseColor='0 1 0.3'/> |
59 | </Appearance> |
60 | </Shape> |
61 | <Shape> |
62 | <Box size='2 25 2'/> |
63 | <Appearance USE='Green'/> |
64 | </Shape> |
65 |
<!-- ROUTE information for SecondSpinGroup node:
[from ActivateSecondSpinGroup.touchTime to startTime
]
-->
<ProtoInstance name='SpinGroup' DEF='SecondSpinGroup'> |
66 | <fieldValue name='cycleInterval' value='4'/> |
67 | <fieldValue name='loop' value='true'/> |
68 | <!-- stopTime > startTime ensures that initial state is stopped --> |
69 | <fieldValue name='stopTime' value='1'/> |
70 | <fieldValue name='children'> |
71 |
<!-- ROUTE information for ActivateSecondSpinGroup node:
[from touchTime to SecondSpinGroup.startTime
]
-->
<TouchSensor DEF='ActivateSecondSpinGroup' description='Activate second SpinGroup by clicking blue bar'/> |
72 | <Shape> |
73 | <Box size='2 2.05 25'/> |
74 | <Appearance> |
75 | <Material diffuseColor='0 0.3 1'/> |
76 | </Appearance> |
77 | </Shape> |
78 | </fieldValue> |
79 | </ProtoInstance> |
80 | </fieldValue> |
81 | </ProtoInstance> |
82 | < ROUTE fromNode='ActivateSecondSpinGroup' fromField='touchTime' toNode='SecondSpinGroup' toField='startTime'/> |
83 | </Scene> |
84 | </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.
ActivateSecondSpinGroup
TouchSensor touchTime SFTime |
SecondSpinGroup
ProtoInstance startTime SFTime |
SpinGroupClock
TimeSensor fraction_changed SFFloat |
Spinner
OrientationInterpolator set_fraction SFFloat |
then
|
Spinner
OrientationInterpolator value_changed SFRotation |
SpinGroupTransform
Transform set_rotation SFRotation |
ProtoInstance SpinGroup |
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. |
<!--
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>
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->