1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
|
3 | <X3D profile='Immersive' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'> |
4 | <head> |
5 | <meta name='title' content='ExtrusionCrossSectionPrototype.x3d'/> |
6 | <meta name='creator' content='Don Brutzman'/> |
7 | <meta name='created' content='22 November 2000'/> |
8 | <meta name='modified' content='20 January 2024'/> |
9 | <meta name='reference' content='ExtrusionExampleShip.x3d'/> |
10 | <meta name='reference' content='ExtrusionCrossSectionExampleShip.x3d'/> |
11 | <meta name='reference' content='ExtrusionCrossSectionExampleTorus.x3d'/> |
12 | <meta name='description' content='Shape prototype for Extrusion node that also draws spine line plus oriented, scaled cross sections at each spine point.'/> |
13 | <meta name='hint' content='Utilize ExtrusionCrossSection ProtoInstance as if it is a Shape node (with containerField="children") rather than an Extrusion node (with containerField="geometry") under a Shape.'/> |
14 | <meta name='reference' content='https://en.wikipedia.org/wiki/Extrusion'/> |
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/Images/Extrusion.gif'/> |
19 | <meta name='reference' content='http://realism.com/x3d/examples/Extrusion/_frame.html'/> |
20 | <meta name='reference' content='http://www.cs.brown.edu/~gss/vrml/drawpoly.html'/> |
21 | <meta name='reference' content='ExtrusionXj3dGoldberg1999.java'/> |
22 | <meta name='reference' content='http://web3d.metrolink.com/cgi-bin/cvsweb.cgi/x3d/src/com/sun/j3d/loaders/vrml97/impl/Attic/Extrusion.java'/> |
23 | <meta name='reference' content='https://www.web3d.org/x3d/content/examples/Basic/course/ExtrusionCrossSectionPrototype.x3d'/> |
24 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/ExtrusionCrossSectionPrototype.x3d'/> |
25 | <meta name='generator' content='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/> |
26 | <meta name='license' content='../license.html'/> |
27 | </head> |
28 | <Scene> |
29 | <WorldInfo title='ExtrusionCrossSectionPrototype.x3d'/> |
30 | <ProtoDeclare name='ExtrusionCrossSection' appinfo='Shape prototype for Extrusion node that also draws spine line plus oriented scaled cross sections at each spine point'> |
31 | <ProtoInterface> |
32 | <!-- run-time eventIn Extrusion-modification interfaces for VRML97 compatibility --> |
33 |
<field name='name' type='SFString' accessType='initializeOnly'
appinfo='Extrusion name'/> |
34 |
<field name='crossSection' type='MFVec2f' value='1 1 1 -1 -1 -1 -1 1 1 1' accessType='initializeOnly'
appinfo='Extrusion field'/> |
35 |
<field name='spine' type='MFVec3f' value='0 0 0 0 1 0' accessType='initializeOnly'
appinfo='Extrusion field'/> |
36 |
<field name='scale' type='MFVec2f' value='1 1' accessType='initializeOnly'
appinfo='Extrusion field'/> |
37 |
<field name='orientation' type='MFRotation' value='0 0 1 0' accessType='initializeOnly'
appinfo='Extrusion field'/> |
38 |
<field name='beginCap' type='SFBool' value='false' accessType='initializeOnly'
appinfo='Extrusion field'/> |
39 |
<field name='endCap' type='SFBool' value='false' accessType='initializeOnly'
appinfo='Extrusion field'/> |
40 |
<field name='ccw' type='SFBool' value='true' accessType='initializeOnly'
appinfo='Extrusion field'/> |
41 |
<field name='convex' type='SFBool' value='true' accessType='initializeOnly'
appinfo='Extrusion field'/> |
42 |
<field name='creaseAngle' type='SFFloat' value='0' accessType='initializeOnly'
appinfo='Extrusion field'/> |
43 |
<field name='solid' type='SFBool' value='true' accessType='initializeOnly'
appinfo='Extrusion field'/> |
44 |
<field name='spineColor' type='SFColor' value='0 0.9 0.8' accessType='inputOutput'
appinfo='emissiveColor of spine'/> |
45 |
<field name='crossSectionColor' type='SFColor' value='0.2 0.8 0.3' accessType='inputOutput'
appinfo='diffuseColor of crossSection'/> |
46 |
<field name='crossSectionTransparency' type='SFFloat' value='0.2' accessType='inputOutput'
appinfo='transparency of crossSection'/> |
47 |
<field name='extrusionColor' type='SFColor' value='0.3 0.3 0.3' accessType='inputOutput'
appinfo='diffuseColor of extrusion hull'/> |
48 |
<field name='extrusionTransparency' type='SFFloat' value='0.7' accessType='inputOutput'
appinfo='transparency of extrusion hull'/> |
49 |
<field name='extrusionImageTexture' type='SFNode' accessType='initializeOnly'
appinfo='Image to apply to Extrusion'> |
50 | <!-- initialization node (if any) goes here --> |
51 | </field> |
52 |
<field name='extrusionTextureTransform' type='SFNode' accessType='initializeOnly'
appinfo='TextureTransform coordinates of image applied to Extrusion'> |
53 | <!-- initialization node (if any) goes here --> |
54 | </field> |
55 |
<field name='set_crossSection' type='MFVec2f' accessType='inputOnly'
appinfo='Extrusion field'/> |
56 |
<field name='set_spine' type='MFVec3f' accessType='inputOnly'
appinfo='Extrusion field'/> |
57 |
<field name='set_scale' type='MFVec2f' accessType='inputOnly'
appinfo='Extrusion field'/> |
58 |
<field name='set_orientation' type='MFRotation' accessType='inputOnly'
appinfo='Extrusion field'/> |
59 |
<field name='traceEnabled' type='SFBool' value='false' accessType='initializeOnly'
appinfo='Whether to provide initialization trace statements showing node construction'/> |
60 | </ProtoInterface> |
61 | <ProtoBody> |
62 | <Group> |
63 | <Shape DEF='Spine'> |
64 |
<!-- ROUTE information for SpineLine node:
[from CrossSectionScript.spineIndex to set_coordIndex
]
-->
<IndexedLineSet DEF='SpineLine' colorPerVertex='false'> |
65 | <Coordinate DEF='SpineCoordinates'> |
66 | <IS> |
67 | <connect nodeField='point' protoField='spine'/> |
68 | <connect nodeField='set_point' protoField='set_spine'/> |
69 | </IS> |
70 | </Coordinate> |
71 | </IndexedLineSet> |
72 | <Appearance> |
73 | <Material DEF='SpineMaterial'> |
74 | <IS> |
75 | <connect nodeField='emissiveColor' protoField='spineColor'/> |
76 | </IS> |
77 | </Material> |
78 | </Appearance> |
79 | </Shape> |
80 | <Shape DEF='InternalCrossSections'> |
81 | <!-- use most conservative polygon settings for reliable rendering: convex='false' solid='false' --> |
82 |
<!-- ROUTE information for CrossSectionFaces node:
[from CrossSectionScript.facesIndex to set_coordIndex
]
-->
<IndexedFaceSet DEF='CrossSectionFaces' convex='false' solid='false'> |
83 |
<!-- ROUTE information for CrossSectionFacesCoordinates node:
[from CrossSectionScript.facePoints to point
]
-->
<Coordinate DEF='CrossSectionFacesCoordinates'/> |
84 | </IndexedFaceSet> |
85 | <Appearance> |
86 | <Material DEF='CrossSectionMaterial'> |
87 | <IS> |
88 | <connect nodeField='diffuseColor' protoField='crossSectionColor'/> |
89 | <connect nodeField='transparency' protoField='crossSectionTransparency'/> |
90 | </IS> |
91 | </Material> |
92 | </Appearance> |
93 | </Shape> |
94 | <Shape DEF='ExternalExtrusion'> |
95 | <!-- use most conservative polygon settings: convex='false' solid='false' --> |
96 | <Extrusion DEF='EnclosingExtrusion' convex='false' solid='false'> |
97 | <IS> |
98 | <connect nodeField='crossSection' protoField='crossSection'/> |
99 | <connect nodeField='spine' protoField='spine'/> |
100 | <connect nodeField='scale' protoField='scale'/> |
101 | <connect nodeField='orientation' protoField='orientation'/> |
102 | <connect nodeField='set_crossSection' protoField='set_crossSection'/> |
103 | <connect nodeField='set_spine' protoField='set_spine'/> |
104 | <connect nodeField='set_scale' protoField='set_scale'/> |
105 | <connect nodeField='set_orientation' protoField='set_orientation'/> |
106 | <connect nodeField='beginCap' protoField='beginCap'/> |
107 | <connect nodeField='endCap' protoField='endCap'/> |
108 | <connect nodeField='ccw' protoField='ccw'/> |
109 | <connect nodeField='convex' protoField='convex'/> |
110 | <connect nodeField='creaseAngle' protoField='creaseAngle'/> |
111 | <connect nodeField='solid' protoField='solid'/> |
112 | </IS> |
113 | </Extrusion> |
114 | <Appearance DEF='ExtrusionAppearance'> |
115 | <IS> |
116 | <connect nodeField='texture' protoField='extrusionImageTexture'/> |
117 | <connect nodeField='textureTransform' protoField='extrusionTextureTransform'/> |
118 | </IS> |
119 | <Material DEF='ExtrusionMaterial'> |
120 | <IS> |
121 | <connect nodeField='diffuseColor' protoField='extrusionColor'/> |
122 | <connect nodeField='transparency' protoField='extrusionTransparency'/> |
123 | </IS> |
124 | </Material> |
125 | </Appearance> |
126 | </Shape> |
127 | </Group> |
128 |
<!-- ROUTE information for CrossSectionScript node:
[from spineIndex to SpineLine.set_coordIndex
]
[from facesIndex to CrossSectionFaces.set_coordIndex
]
[from facePoints to CrossSectionFacesCoordinates.point
]
-->
<Script DEF='CrossSectionScript' url=' "ExtrusionCrossSectionPrototype.js" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/ExtrusionCrossSectionPrototype.js" '> |
129 | <!-- local variables --> |
130 | <field name='name' type='SFString' accessType='initializeOnly'/> |
131 | <field name='crossSection' type='MFVec2f' accessType='initializeOnly'/> |
132 | <field name='spine' type='MFVec3f' accessType='initializeOnly'/> |
133 | <field name='scale' type='MFVec2f' accessType='initializeOnly'/> |
134 | <field name='orientation' type='MFRotation' accessType='initializeOnly'/> |
135 | <field name='spineColor' type='SFColor' accessType='inputOutput'/> |
136 | <field name='crossSectionColor' type='SFColor' accessType='inputOutput'/> |
137 | <field name='crossSectionTransparency' type='SFFloat' accessType='inputOutput'/> |
138 | <field name='extrusionColor' type='SFColor' accessType='inputOutput'/> |
139 | <field name='extrusionTransparency' type='SFFloat' accessType='inputOutput'/> |
140 | <field name='set_crossSection' type='MFVec2f' accessType='inputOnly'/> |
141 | <field name='set_spine' type='MFVec3f' accessType='inputOnly'/> |
142 | <field name='set_scale' type='MFVec2f' accessType='inputOnly'/> |
143 | <field name='set_orientation' type='MFRotation' accessType='inputOnly'/> |
144 | <field name='spineIndex' type='MFInt32' accessType='outputOnly'/> |
145 | <field name='facesIndex' type='MFInt32' accessType='outputOnly'/> |
146 | <field name='facePoints' type='MFVec3f' accessType='outputOnly'/> |
147 | <field name='traceEnabled' type='SFBool' accessType='initializeOnly'/> |
148 | <field name='computedFacesIndex' type='MFInt32' accessType='initializeOnly'/> |
149 | <field name='computedFacePoints' type='MFVec3f' accessType='initializeOnly'/> |
150 | <IS> |
151 | <connect nodeField='name' protoField='name'/> |
152 | <connect nodeField='crossSection' protoField='crossSection'/> |
153 | <connect nodeField='spine' protoField='spine'/> |
154 | <connect nodeField='scale' protoField='scale'/> |
155 | <connect nodeField='spineColor' protoField='spineColor'/> |
156 | <connect nodeField='crossSectionColor' protoField='crossSectionColor'/> |
157 | <connect nodeField='crossSectionTransparency' protoField='crossSectionTransparency'/> |
158 | <connect nodeField='extrusionColor' protoField='extrusionColor'/> |
159 | <connect nodeField='extrusionTransparency' protoField='extrusionTransparency'/> |
160 | <connect nodeField='orientation' protoField='orientation'/> |
161 | <connect nodeField='set_crossSection' protoField='set_crossSection'/> |
162 | <connect nodeField='set_spine' protoField='set_spine'/> |
163 | <connect nodeField='set_scale' protoField='set_scale'/> |
164 | <connect nodeField='set_orientation' protoField='set_orientation'/> |
165 | <connect nodeField='traceEnabled' protoField='traceEnabled'/> |
166 | </IS> |
167 | </Script> |
168 | < ROUTE fromNode='CrossSectionScript' fromField='spineIndex' toNode='SpineLine' toField='set_coordIndex'/> |
169 | < ROUTE fromNode='CrossSectionScript' fromField='facesIndex' toNode='CrossSectionFaces' toField='set_coordIndex'/> |
170 | < ROUTE fromNode='CrossSectionScript' fromField='facePoints' toNode='CrossSectionFacesCoordinates' toField='point'/> |
171 | </ProtoBody> |
172 | </ProtoDeclare> |
173 | <!-- ==================== --> |
174 | <!-- Example instance adapted from Figure15.12Torus.x3d --> |
175 | <!-- https://www.web3d.org/x3d/content/examples/Basic/Vrml2Sourcebook/Chapter15-Extrusion/Figure15.12Torus.x3d --> |
176 | <!-- Redirection text in case a user examines this PROTO file via a 3D browser: --> |
177 | <Group> |
178 | <Transform translation='0 1.5 0'> |
179 | <Shape> |
180 | <Appearance> |
181 | <Material diffuseColor='0 1 1' emissiveColor='0 1 1'/> |
182 | </Appearance> |
183 | <Text string='"ExtrusionCrossSectionPrototype" "is a Prototype definition scene." "" "Example scenes using this node:"'> |
184 | <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.9'/> |
185 | </Text> |
186 | </Shape> |
187 | </Transform> |
188 | <Transform translation='0 -0.8 0'> |
189 | <Anchor description='Touch text for ExtrusionPentagon example' parameter='"target=_blank"' url=' "ExtrusionPentagon.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/ExtrusionPentagon.x3d" "ExtrusionPentagon.wrl" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/ExtrusionPentagon.wrl" '> |
190 | <Shape> |
191 | <Appearance> |
192 | <Material diffuseColor='0 1 0.341176' transparency='0.2'/> |
193 | </Appearance> |
194 | <Text string='"Pentagon"'> |
195 |
<!-- FontStyle
FontCenter is a DEF node that has 2 USE nodes: USE_1, USE_2 --> <FontStyle DEF='FontCenter' justify='"MIDDLE" "MIDDLE"' size='1.2' style='BOLD'/> |
196 | </Text> |
197 | </Shape> |
198 | <Shape> |
199 | <Box size='3 1 0.01'/> |
200 |
<!-- Appearance
TransparentAppearance is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
<Appearance DEF='TransparentAppearance'> |
201 | <Material transparency='1'/> |
202 | </Appearance> |
203 | </Shape> |
204 | </Anchor> |
205 | </Transform> |
206 | <Transform translation='-2.5 -2 0'> |
207 | <Anchor description='Touch text for Torus example' parameter='"target=_blank"' url=' "../../Basic/course/ExtrusionCrossSectionExampleTorus.x3d" "https://www.web3d.org/x3d/content/examples/Basic/course/ExtrusionCrossSectionExampleTorus.x3d" "../../Basic/course/ExtrusionCrossSectionExampleTorus.wrl" "https://www.web3d.org/x3d/content/examples/Basic/course/ExtrusionCrossSectionExampleTorus.wrl" '> |
208 | <Shape> |
209 | <Appearance> |
210 | <Material diffuseColor='1 0 1' transparency='0.2'/> |
211 | </Appearance> |
212 | <Text string='"Torus"'> |
213 | <FontStyle USE='FontCenter'/> |
214 | </Text> |
215 | </Shape> |
216 | <Shape> |
217 | <Box size='3 1 0.01'/> |
218 | <Appearance USE='TransparentAppearance'/> |
219 | </Shape> |
220 | </Anchor> |
221 | </Transform> |
222 | <Transform translation='2.5 -2 0'> |
223 | <Anchor description='Touch text for Ship example' parameter='"target=_blank"' url=' "../../Basic/course/ExtrusionCrossSectionExampleShip.x3d" "https://www.web3d.org/x3d/content/examples/Basic/course/ExtrusionCrossSectionExampleShip.x3d" "../../Basic/course/ExtrusionCrossSectionExampleShip.wrl" "https://www.web3d.org/x3d/content/examples/Basic/course/ExtrusionCrossSectionExampleShip.wrl" '> |
224 | <Shape> |
225 | <Appearance> |
226 | <Material diffuseColor='0.7 0.7 0.7' transparency='0.2'/> |
227 | </Appearance> |
228 | <Text string='"Ship"'> |
229 | <FontStyle USE='FontCenter'/> |
230 | </Text> |
231 | </Shape> |
232 | <Shape> |
233 | <Box size='2 1 0.01'/> |
234 | <Appearance USE='TransparentAppearance'/> |
235 | </Shape> |
236 | </Anchor> |
237 | </Transform> |
238 | </Group> |
239 | </Scene> |
240 | </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.
CrossSectionScript
Script spineIndex MFInt32 |
SpineLine
IndexedLineSet set_coordIndex MFInt32 |
|
CrossSectionScript
Script facesIndex MFInt32 |
CrossSectionFaces
IndexedFaceSet set_coordIndex MFInt32 |
|
CrossSectionScript
Script facePoints MFVec3f |
CrossSectionFacesCoordinates
Coordinate point MFVec3f |
Anchor |
description='Touch text for ExtrusionPentagon example' User-interaction hint for this node. |
Anchor |
description='Touch text for Torus example' User-interaction hint for this node. |
Anchor |
description='Touch text for Ship example' User-interaction hint for this node. |
<!--
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)
<ProtoDeclare
name='ProtoName'>
<field
name='fieldName'/> </ProtoDeclare>
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->