1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.2//EN" "https://www.web3d.org/specifications/x3d-3.2.dtd">
|
3 | <X3D profile='Immersive' version='3.2' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.2.xsd'> |
4 | <head> |
5 | <meta name='title' content='ExtrusionCrossSectionExampleShip.x3d'/> |
6 | <meta name='creator' content='Don Brutzman'/> |
7 | <meta name='created' content='20 December 1999'/> |
8 | <meta name='modified' content='20 October 2019'/> |
9 | <meta name='description' content='Ship model as example use of ExtrusionCrossSectionPrototype for drawing several different Extrusion spines and cross sections.'/> |
10 | <meta name='Image' content='ExtrusionCrossSectionExampleShip.png'/> |
11 | <meta name='hint' content='Utilize ExtrusionCrossSection ProtoInstance as a Shape node (with containerField="children") rather than an Extrusion node (with containerField="geometry").'/> |
12 | <meta name='reference' content='ExtrusionExampleShip.x3d'/> |
13 | <meta name='reference' content='ExtrusionCrossSectionExampleTorus.x3d'/> |
14 | <meta name='reference' content='ExtrusionCrossSectionPrototype.x3d'/> |
15 | <meta name='reference' content='VRML 97 Specification, 6.18 Extrusion'/> |
16 | <meta name='reference' content='https://www.web3d.org/technicalinfo/specifications/vrml97/part1/nodesRef.html#Extrusion'/> |
17 | <meta name='Image' content='VRML 97 Specification, Figure 6.6'/> |
18 | <meta name='Image' content='https://www.web3d.org/technicalinfo/specifications/vrml97/part1/Images/Extrusion.gif'/> |
19 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/Basic/course/ExtrusionCrossSectionExampleShip.x3d'/> |
20 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
21 | <meta name='license' content='../license.html'/> |
22 | </head> |
23 | <Scene> |
24 | <!-- Utilize ExtrusionCrossSection ProtoInstance as a Shape node (with containerField="children") rather than an Extrusion node (with containerField="geometry"). --> |
25 | <WorldInfo title='ExtrusionCrossSectionExampleShip.x3d'/> |
26 | <ExternProtoDeclare name='ExtrusionCrossSection' appinfo='Shape prototype for Extrusion node that also draws spine line plus oriented scaled cross sections at each spine point' documentation='https://www.web3d.org/x3d/content/examples/Basic/course/ExtrusionCrossSectionPrototype.x3d' url=' "ExtrusionCrossSectionPrototype.x3d#ExtrusionCrossSection" "https://www.web3d.org/x3d/content/examples/Basic/course/ExtrusionCrossSectionPrototype.x3d#ExtrusionCrossSection" "ExtrusionCrossSectionPrototype.wrl#ExtrusionCrossSection" "https://www.web3d.org/x3d/content/examples/Basic/course/ExtrusionCrossSectionPrototype.wrl#ExtrusionCrossSection" '> |
27 | <!-- run-time eventIn Extrusion-modification interfaces for VRML 97 compatibility --> |
28 |
<field name='name' type='SFString' accessType='initializeOnly'
appinfo='Extrusion name'/> |
29 |
<field name='crossSection' type='MFVec2f' accessType='initializeOnly'
appinfo='Extrusion field'/> |
30 |
<field name='spine' type='MFVec3f' accessType='initializeOnly'
appinfo='Extrusion field'/> |
31 |
<field name='scale' type='MFVec2f' accessType='initializeOnly'
appinfo='Extrusion field'/> |
32 |
<field name='orientation' type='MFRotation' accessType='initializeOnly'
appinfo='Extrusion field'/> |
33 |
<field name='beginCap' type='SFBool' accessType='initializeOnly'
appinfo='Extrusion field'/> |
34 |
<field name='endCap' type='SFBool' accessType='initializeOnly'
appinfo='Extrusion field'/> |
35 |
<field name='ccw' type='SFBool' accessType='initializeOnly'
appinfo='Extrusion field'/> |
36 |
<field name='convex' type='SFBool' accessType='initializeOnly'
appinfo='Extrusion field'/> |
37 |
<field name='creaseAngle' type='SFFloat' accessType='initializeOnly'
appinfo='Extrusion field'/> |
38 |
<field name='solid' type='SFBool' accessType='initializeOnly'
appinfo='Extrusion field'/> |
39 |
<field name='spineColor' type='SFColor' accessType='inputOutput'
appinfo='emissiveColor of spine'/> |
40 |
<field name='crossSectionColor' type='SFColor' accessType='inputOutput'
appinfo='diffuseColor of crossSection'/> |
41 |
<field name='crossSectionTransparency' type='SFFloat' accessType='inputOutput'
appinfo='transparency of crossSection'/> |
42 |
<field name='extrusionColor' type='SFColor' accessType='inputOutput'
appinfo='diffuseColor of extrusion hull'/> |
43 |
<field name='extrusionTransparency' type='SFFloat' accessType='inputOutput'
appinfo='transparency of extrusion hull'/> |
44 |
<field name='extrusionImageTexture' type='SFNode' accessType='initializeOnly'
appinfo='Image to apply to Extrusion'/> |
45 |
<field name='extrusionTextureTransform' type='SFNode' accessType='initializeOnly'
appinfo='TextureTransform coordinates of image applied to Extrusion'/> |
46 |
<field name='set_crossSection' type='MFVec2f' accessType='inputOnly'
appinfo='Extrusion field'/> |
47 |
<field name='set_spine' type='MFVec3f' accessType='inputOnly'
appinfo='Extrusion field'/> |
48 |
<field name='set_scale' type='MFVec2f' accessType='inputOnly'
appinfo='Extrusion field'/> |
49 |
<field name='set_orientation' type='MFRotation' accessType='inputOnly'
appinfo='Extrusion field'/> |
50 |
<field name='traceEnabled' type='SFBool' accessType='initializeOnly'
appinfo='Whether to provide initialization trace statements showing node construction'/> |
51 | </ExternProtoDeclare> |
52 | <!-- ==================== --> |
53 | <!-- Example instance --> |
54 | <NavigationInfo speed='4'/> |
55 | <Viewpoint description='ship hull' position='0 0 40'/> |
56 | <Viewpoint description='stack' position='8 5 20'/> |
57 | <Viewpoint description='smoke extrusion start' position='6.8 7 10'/> |
58 | <Viewpoint description='forward starboard quarter' orientation='0 1 0 0.5' position='20 3 25'/> |
59 | <Transform rotation='0 1 0 1.57' translation='15 30 0'> |
60 | <Viewpoint description='touch smoke to animate' orientation='1 0 0 -1' position='0 0 0'/> |
61 | </Transform> |
62 | <Background groundColor='0.7 0.7 0.7' skyAngle='0.05 1.5 1.59' skyColor='0.6 0.6 0.4 0.4 0.4 0.7 0.3 0.3 0.6 0.1 0.1 0.3'/> |
63 | <!-- ==================== --> |
64 | <Transform DEF='SmokePosition' translation='5.8 7 0'> |
65 | <!-- Smoke shows that crossSection, spine, scale and orientation can be animated --> |
66 |
<!-- ROUTE information for Smoke node:
[from SmokeSpineInterpolator.value_changed to set_spine
]
-->
<ProtoInstance name='ExtrusionCrossSection' DEF='Smoke'> |
67 | <fieldValue name='name' value='Smoke'/> |
68 | <fieldValue name='crossSection' value='0 1 -1 0 0 -0.5 1.5 0 0 1'/> |
69 | <fieldValue name='spine' value='0 0 0 -1 0 0 -2 0 0 -3 0 0 -5 0 0'/> |
70 | <fieldValue name='scale' value='0.8 0.7 0.7 0.6 0.6 0.5 0.5 0.3 0.4 0.2'/> |
71 | <fieldValue name='orientation' value='0 1 0 0 0 1 0 0 0 1 0 -0.4 0 1 0 0 1 0 0 0.4'/> |
72 | <fieldValue name='creaseAngle' value='1'/> |
73 | <fieldValue name='solid' value='false'/> |
74 | <fieldValue name='spineColor' value='1 1 1'/> |
75 | <fieldValue name='crossSectionColor' value='0.2 0.2 0.6'/> |
76 | <fieldValue name='extrusionColor' value='0.0 0.9 0.9'/> |
77 | <fieldValue name='extrusionTransparency' value='0.5'/> |
78 | <fieldValue name='traceEnabled' value='false'/> |
79 | </ProtoInstance> |
80 |
<!-- ROUTE information for TouchSmoke node:
[from touchTime to SmokeClock.startTime
]
-->
<TouchSensor DEF='TouchSmoke' description='click smoke to animate'/> |
81 |
<!-- ROUTE information for SmokeClock node:
[from TouchSmoke.touchTime to startTime
]
[from fraction_changed to SmokeSpineInterpolator.set_fraction
]
-->
<TimeSensor DEF='SmokeClock' cycleInterval='30' startTime='-1'/> |
82 |
<!-- ROUTE information for SmokeSpineInterpolator node:
[from SmokeClock.fraction_changed to set_fraction
]
[from value_changed to Smoke.set_spine
]
-->
<CoordinateInterpolator DEF='SmokeSpineInterpolator' key='0 0.2 0.5 0.8 1' keyValue='0 0 0 -1 0 0 -2 0 0 -3 0 0 -5 0 0 0 0 0 -2 0 0 -4 -0.5 0 -6 -1 0 -8 -2 0 0 0 0 -4 0 0 -8 -1 0 -13 -2 0 -20 -2.5 0 0 0 0 -2 0 0 -4 -0.5 0 -6 -1 0 -8 -2 0 0 0 0 -1 0 0 -2 0 0 -3 0 0 -5 0 0'/> |
83 | < ROUTE fromNode='TouchSmoke' fromField='touchTime' toNode='SmokeClock' toField='startTime'/> |
84 | < ROUTE fromNode='SmokeClock' fromField='fraction_changed' toNode='SmokeSpineInterpolator' toField='set_fraction'/> |
85 | < ROUTE fromNode='SmokeSpineInterpolator' fromField='value_changed' toNode='Smoke' toField='set_spine'/> |
86 | </Transform> |
87 | <Transform DEF='SuperstructurePosition' translation='12 1 0'> |
88 | <ProtoInstance name='ExtrusionCrossSection' DEF='Superstructure'> |
89 | <fieldValue name='name' value='Superstructure'/> |
90 | <fieldValue name='crossSection' value='0.1 1 0.1 -1 -1 -1 -1 1 0.1 1'/> |
91 | <fieldValue name='spine' value='0 0 0 0 1 0 0 1.95 0 0 1.96 0 0 3 0'/> |
92 | <fieldValue name='scale' value='6 2 6 2 6 2 1 1.8 1 1.8'/> |
93 | <fieldValue name='spineColor' value='0.7 0.7 0'/> |
94 | <fieldValue name='ccw' value='true'/> |
95 | <fieldValue name='crossSectionColor' value='0.6 0.6 0.2'/> |
96 | <fieldValue name='extrusionColor' value='0.3 0.6 0.6'/> |
97 | <fieldValue name='extrusionTransparency' value='0.6'/> |
98 | <fieldValue name='traceEnabled' value='false'/> |
99 | </ProtoInstance> |
100 | </Transform> |
101 | <Transform DEF='StackPosition' translation='8 1 0'> |
102 | <ProtoInstance name='ExtrusionCrossSection' DEF='Stack'> |
103 | <fieldValue name='name' value='Stack'/> |
104 | <fieldValue name='crossSection' value='0 1 0.38 0.92 0.71 0.71 0.92 0.38 1 0 0.92 -0.38 0.71 -0.71 0.38 -0.92 0 -1 -0.38 -0.92 -0.71 -0.71 -0.92 -0.38 -1 0 -0.92 0.38 -0.71 0.71 -0.38 0.92 0 1'/> |
105 | <fieldValue name='spine' value='0.1 2 0 0 5 0 -0.4 5.6 0 -1 6 0'/> |
106 | <fieldValue name='scale' value='1 1 1 1 0.9 0.85 0.8 0.4'/> |
107 | <fieldValue name='orientation' value='0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 0.4'/> |
108 | <fieldValue name='spineColor' value='1 1 1'/> |
109 | <fieldValue name='creaseAngle' value='1'/> |
110 | <fieldValue name='crossSectionColor' value='0.8 0.2 0.2'/> |
111 | <fieldValue name='crossSectionTransparency' value='0.1'/> |
112 | <fieldValue name='extrusionColor' value='0.3 0.3 0.3'/> |
113 | <fieldValue name='extrusionTransparency' value='0.5'/> |
114 | <fieldValue name='traceEnabled' value='false'/> |
115 | </ProtoInstance> |
116 | </Transform> |
117 | <Transform DEF='HullPosition' translation='0 1 0'> |
118 | <ProtoInstance name='ExtrusionCrossSection' DEF='Hull'> |
119 | <fieldValue name='name' value='Hull'/> |
120 | <fieldValue name='solid' value='false'/> |
121 | <fieldValue name='crossSection' value='0 1 0.38 0.92 0.71 0.71 0.92 0.38 1 0 0.92 -0.38 0.71 -0.71 0.38 -0.92 0 -1'/> |
122 | <fieldValue name='spine' value='-20 0 0 -17 0 0 0 0 0 10 0 0 22 1 0'/> |
123 | <fieldValue name='scale' value='3 4 4 4 4 4 4 4 5 .1'/> |
124 | <fieldValue name='orientation' value='1 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -0.5'/> |
125 | <fieldValue name='traceEnabled' value='false'/> |
126 | </ProtoInstance> |
127 | </Transform> |
128 | <!-- ==================== --> |
129 | <!-- Display world coordinate axes at (0 0 0) --> |
130 | <Transform scale='5 5 5'> |
131 |
<!-- Inline
CoordinateAxes is a DEF node that has 1 USE node: USE_1 --> <Inline DEF='CoordinateAxes' url=' "../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "../../Savage/Tools/Authoring/CoordinateAxes.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "https://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.x3d" "../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl" "../../Savage/Tools/Authoring/CoordinateAxes.wrl" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl" "https://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.wrl" '/> |
132 | </Transform> |
133 | <!-- Display smoke extrusion coordinate axes: y along spine, x pointing up --> |
134 | <Transform translation='6 8.5 0'> |
135 | <Transform rotation='0 0 1 1.57'> |
136 | <Inline USE='CoordinateAxes'/> |
137 | </Transform> |
138 | </Transform> |
139 | </Scene> |
140 | </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.
TouchSmoke
TouchSensor touchTime SFTime |
SmokeClock
TimeSensor startTime SFTime |
then
|
SmokeClock
TimeSensor fraction_changed SFFloat |
SmokeSpineInterpolator
CoordinateInterpolator set_fraction SFFloat |
then
|
SmokeSpineInterpolator
CoordinateInterpolator value_changed MFVec3f |
Smoke
ProtoInstance set_spine MFVec3f |
Hull
ProtoInstance ExtrusionCrossSection |
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. |
Stack
ProtoInstance ExtrusionCrossSection |
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. |
Superstructure
ProtoInstance ExtrusionCrossSection |
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. -->