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