| 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=' RenderingComponentPrototypes.x3d '/> |
| 6 | <meta name='description' content='Prototype implementations of X3D Rendering component nodes (IndexedTriangleFanSet IndexedTriangleSet IndexedTriangleStripSet LineSet TriangleFanSet TriangleSet TriangleStripSet) implemented as prototypes for backwards compatibility with VRML 97.'/> |
| 7 | <meta name='info' content='X3dToVrml97.xslt translation stylesheet automatically invokes these prototypes upon encountering any new Rendering nodes.'/> |
| 8 | <meta name='creator' content='Don Brutzman, George Dabrowski, Ken Curtin, Duane Davis, Christos Kalogrias'/> |
| 9 | <meta name='created' content='17 November 2003'/> |
| 10 | <meta name='modified' content='9 October 2023'/> |
| 11 | <meta name='reference' content=' RenderingComponentExamples.x3d '/> |
| 12 | <meta name='reference' content=' RenderingComponentExternProtoDefinitions.x3d '/> |
| 13 | <meta name='reference' content=' https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/rendering.html '/> |
| 14 | <meta name='reference' content=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter13-PointsLinesFaces/Figure13.11IndexedLineSetBoxWireframe.x3d '/> |
| 15 | <meta name='subject' content='X3D Rendering component nodes (IndexedTriangleFanSet IndexedTriangleSet IndexedTriangleStripSet LineSet TriangleFanSet TriangleSet TriangleStripSet)'/> |
| 16 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Basic/development/RenderingComponentPrototypes.x3d '/> |
| 17 | <meta name='generator' content='X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 18 | <meta name='license' content='../license.html'/> |
| 19 | </head> |
| 20 | <Scene> |
| 21 | <!-- ==================== --> |
| 22 | <WorldInfo title='RenderingComponentPrototypes.x3d'/> |
| 23 | <ProtoDeclare name='ColorRGBA' appinfo='ColorRGBA defines a set of RGBA colors. Warning: VRML 97 support does not include alpha values.'> |
| 24 | <ProtoInterface> |
| 25 |
<field name='color' type='MFRotation' accessType='inputOutput'
appinfo='locally override MFColorRGBA type (which is not supported in VRML 97) in order to downgrade to Color RGB'> |
| 26 | <!-- The color field is a 4-tuple float array, and so we map it to an MFOrientation for backwards compatibility with VRML 97. --> |
| 27 | </field> |
| 28 |
<field name='metadata' type='SFNode' accessType='inputOutput'
appinfo='Metadata node only'> |
| 29 | <!-- default initialization is NULL node to match X3D specification --> |
| 30 | </field> |
| 31 | </ProtoInterface> |
| 32 | <ProtoBody> |
| 33 | |
| 34 | <!-- remaining nodes are not rendered --> |
| 35 |
<!-- OrientationInterpolator
ColorRGBAholder is a DEF node that has 1 USE node: USE_1 -->
<OrientationInterpolator DEF='ColorRGBAholder'> |
| 36 | <IS> |
| 37 | <connect nodeField='keyValue' protoField='color'/> |
| 38 | </IS> |
| 39 | </OrientationInterpolator> |
| 40 | <Script DEF='ConvertColorRGBAtoRGB' directOutput='true'> |
| 41 | <field name='colorRGBAnode' type='SFNode' accessType='initializeOnly'> |
| 42 | <OrientationInterpolator USE='ColorRGBAholder'/> |
| 43 | </field> |
| 44 | <field name='colorRGBnode' type='SFNode' accessType='initializeOnly'> |
| 45 | <Color USE='ColorRGB'/> |
| 46 | </field> |
<![CDATA[
ecmascript:
function initialize ()
{
// Browser.println ('colorRGBAnode.keyValue.length=' + colorRGBAnode.keyValue.length);
for (i=0; i<=colorRGBAnode.keyValue.length-1; i++)
{
// type conversion of each array element
// specifically, colorRGBAnode.keyValue[i] is an SFRotation
// and individual element values are then extracted from that
nextColor = new SFColor (
colorRGBAnode.keyValue[i].x,
colorRGBAnode.keyValue[i].y,
colorRGBAnode.keyValue[i].z);
// note colorRGBAnode.keyValue[i].angle holds the alpha value; ignored
// Browser.println ('color[' + i + ']=' + nextColor);
colorRGBnode.color[i] = nextColor;
}
}
]]>
|
|
| 48 | </Script> |
| 49 | <Group> |
| 50 | <MetadataSet> |
| 51 | <IS> |
| 52 | <connect nodeField='metadata' protoField='metadata'/> |
| 53 | </IS> |
| 54 | </MetadataSet> |
| 55 | </Group> |
| 56 | </ProtoBody> |
| 57 | </ProtoDeclare> |
| 58 | <!-- ==================== --> |
| 59 | <ProtoDeclare name='IndexedTriangleFanSet' appinfo='IndexedTriangleFanSet represents a 3D shape composed of triangles that form a fan shape around the first vertex declared in each fan.'> |
| 60 | <ProtoInterface> |
| 61 | <field name='ccw' type='SFBool' value='true' accessType='initializeOnly'/> |
| 62 | <field name='colorPerVertex' type='SFBool' value='true' accessType='initializeOnly'/> |
| 63 | <field name='normalPerVertex' type='SFBool' value='true' accessType='initializeOnly'/> |
| 64 | <field name='solid' type='SFBool' value='true' accessType='initializeOnly'/> |
| 65 |
<field name='set_index' type='MFInt32' accessType='inputOnly'
appinfo='[0 infinity] or -1'/> |
| 66 |
<field name='index' type='MFInt32' accessType='initializeOnly'
appinfo='[0 infinity] or -1'> |
| 67 | <!-- default initialization is NULL array [] to match X3D specification --> |
| 68 | </field> |
| 69 |
<field name='color' type='SFNode' accessType='inputOutput'
appinfo='Color ColorRGBA node only'> |
| 70 | <!-- default initialization is NULL node to match X3D specification --> |
| 71 | </field> |
| 72 |
<field name='coord' type='SFNode' accessType='inputOutput'
appinfo='Coordinate node only'> |
| 73 | <!-- default initialization is NULL node to match X3D specification --> |
| 74 | </field> |
| 75 |
<field name='metadata' type='SFNode' accessType='inputOutput'
appinfo='Metadata node only'> |
| 76 | <!-- default initialization is NULL node to match X3D specification --> |
| 77 | </field> |
| 78 |
<field name='normal' type='SFNode' accessType='inputOutput'
appinfo='Normal node only'> |
| 79 | <!-- default initialization is NULL node to match X3D specification --> |
| 80 | </field> |
| 81 |
<field name='texCoord' type='SFNode' accessType='inputOutput'
appinfo='TextureCoordinate node only'> |
| 82 | <!-- default initialization is NULL node to match X3D specification --> |
| 83 | </field> |
| 84 | </ProtoInterface> |
| 85 | <ProtoBody> |
| 86 |
<!-- IndexedFaceSet
RenderedITFS is a DEF node that has 1 USE node: USE_1 -->
<IndexedFaceSet DEF='RenderedITFS'> |
| 87 | <IS> |
| 88 | <connect nodeField='ccw' protoField='ccw'/> |
| 89 | <connect nodeField='normalPerVertex' protoField='normalPerVertex'/> |
| 90 | <connect nodeField='solid' protoField='solid'/> |
| 91 | <connect nodeField='color' protoField='color'/> |
| 92 | <connect nodeField='coord' protoField='coord'/> |
| 93 | <connect nodeField='normal' protoField='normal'/> |
| 94 | <connect nodeField='texCoord' protoField='texCoord'/> |
| 95 | </IS> |
| 96 | </IndexedFaceSet> |
| 97 | <Group DEF='UnrenderedITFS'> |
| 98 | <Shape> |
| 99 | <!-- is this really needed at all?? --> |
| 100 |
<!-- IndexedFaceSet
NodesHolderITFS is a DEF node that has 1 USE node: USE_1 -->
<IndexedFaceSet DEF='NodesHolderITFS'> |
| 101 | <IS> |
| 102 | <connect nodeField='color' protoField='color'/> |
| 103 | <connect nodeField='coord' protoField='coord'/> |
| 104 | <connect nodeField='normal' protoField='normal'/> |
| 105 | <connect nodeField='texCoord' protoField='texCoord'/> |
| 106 | </IS> |
| 107 | </IndexedFaceSet> |
| 108 | </Shape> |
| 109 | <Script DEF='IndexedTriangleFanSetToIndexedFaceSet' directOutput='true'> |
| 110 | <field name='index' type='MFInt32' accessType='initializeOnly'/> |
| 111 | <field name='set_index' type='MFInt32' accessType='inputOnly'/> |
| 112 | <field name='renderedITFS' type='SFNode' accessType='initializeOnly'> |
| 113 | <IndexedFaceSet USE='RenderedITFS'/> |
| 114 | </field> |
| 115 | <field name='nodesHolder' type='SFNode' accessType='initializeOnly'> |
| 116 | <IndexedFaceSet USE='NodesHolderITFS'/> |
| 117 | </field> |
| 118 | <field name='localTraceEnabled' type='SFBool' value='true' accessType='initializeOnly'/> |
| 119 | <field name='coordIndexNew' type='MFInt32' accessType='initializeOnly'> |
| 120 | <!-- constructed during initialization --> |
| 121 | </field> |
| 122 | <IS> |
| 123 | <connect nodeField='index' protoField='index'/> |
| 124 | <connect nodeField='set_index' protoField='set_index'/> |
| 125 | </IS> |
<![CDATA[
ecmascript:
function initialize()
{
// index is an array of triangle indices that form a fan shape
// around the first vertex declared in each fan. The ordering of
// the vertices is ccw (counter-clockwise).
// ensure terminated by -1
if (index[index.length-1] != -1) index[index.length] = -1;
// ensure legal index values
for (i=0; i <= index.length-1; i++)
{
if (index[i] < -1)
{
alwaysPrint ('error, index[' + i + ']=' + index[i] +
' is illegal value, treated as -1');
index[i] = -1;
}
}
tracePrint ('index.length=' + index.length);
tracePrint ('index=' + index);
if (index.length < 4)
{
alwaysPrint ('warning, index.length=' + index.length +
' insufficient to construct a triangle, ITFS ignored');
return;
}
j = 0; // coordIndexNew counter
coordIndexNew = new MFInt32 ();
// i walks through index array,
// goal is to initialize coordIndexNew list to match triangles
for (i=2; i <= index.length-1; i++)
{
if ((index[i] == index[i-1]) || (index[i] == index[i-2]) || (index[i-1] == index[i-2]))
{
alwaysPrint ('index=' + index);
alwaysPrint ('error, pair of equal indices in triangle');
return;
}
if (index[i] >= 0)
{
// add another triangle from latest 3 points of fan set to IFS
// swap order to ensure normal is ccw, i.e. in correct halfplane direction
coordIndexNew [coordIndexNew.length] = 0;
coordIndexNew [coordIndexNew.length] = index[i];
coordIndexNew [coordIndexNew.length] = index[i-1];
coordIndexNew [coordIndexNew.length] = -1; // terminate
}
else if (index[i] == -1) // finish current triangle, fan
{
// ensure done, or sufficient points remain to build another triangle
if ( (i!=index.length-1) && (index.length - i < 2))
{
alwaysPrint ('index=' + index);
alwaysPrint ('error, insufficient index values after' +
'index[' + i + ']=-1');
return;
}
// ensure done, or enough legal index values remain to build another triangle
if ( (i!=index.length-1) &&
((index[i+1] == -1) || (index[i+2] == -1) || (index[i+3] == -1)))
{
alwaysPrint ('index=' + index);
alwaysPrint ('error, insufficient non-negative-one index values after' +
'index[' + i + ']=-1');
return;
}
tracePrint ('encountered -1 in index array');
// skip ahead to build next fan set, no effect if done
if (i!=index.length-1) i = i + 2;
}
// incremental trace of array being built
tracePrint ('coordIndexNew=' + coordIndexNew);
}
renderedITFS.set_coordIndex = coordIndexNew;
tracePrint ('renderedITFS.coordIndex=' + renderedITFS.coordIndex);
// match colorIndex if any Color node exists
if (nodesHolder.color)
{
if (nodesHolder.color.color.length > 0)
{
renderedITFS.set_colorIndex = coordIndexNew;
tracePrint ('set_colorIndex=' + coordIndexNew);
}
}
}
function set_index (value, timestamp)
{
index = value;
initialize ();
}
function tracePrint(outputString)
{
if (localTraceEnabled)
Browser.println ('[IndexedTriangleFanSet]' + outputString);
}
function alwaysPrint(outputString)
{
Browser.println ('[IndexedTriangleFanSet]' + outputString);
}
]]>
|
|
| 127 | </Script> |
| 128 | <Group> |
| 129 | <MetadataString> |
| 130 | <IS> |
| 131 | <connect nodeField='metadata' protoField='metadata'/> |
| 132 | </IS> |
| 133 | </MetadataString> |
| 134 | </Group> |
| 135 | </Group> |
| 136 | </ProtoBody> |
| 137 | </ProtoDeclare> |
| 138 | <!-- ==================== --> |
| 139 | <ProtoDeclare name='IndexedTriangleSet' appinfo='IndexedTriangleSet represents a 3D shape composed of a collection of individual triangles.'> |
| 140 | <ProtoInterface> |
| 141 | <field name='ccw' type='SFBool' value='true' accessType='initializeOnly'/> |
| 142 | <field name='colorPerVertex' type='SFBool' value='true' accessType='initializeOnly'/> |
| 143 | <field name='normalPerVertex' type='SFBool' value='true' accessType='initializeOnly'/> |
| 144 | <field name='solid' type='SFBool' value='true' accessType='initializeOnly'/> |
| 145 |
<field name='set_index' type='MFInt32' accessType='inputOnly'
appinfo='[0 infinity] or -1'/> |
| 146 |
<field name='index' type='MFInt32' accessType='initializeOnly'
appinfo='[0 infinity] or -1'> |
| 147 | <!-- default initialization is NULL array [] to match X3D specification --> |
| 148 | </field> |
| 149 |
<field name='color' type='SFNode' accessType='inputOutput'
appinfo='Color ColorRGBA node only'> |
| 150 | <!-- default initialization is NULL node to match X3D specification --> |
| 151 | </field> |
| 152 |
<field name='coord' type='SFNode' accessType='inputOutput'
appinfo='Coordinate node only'> |
| 153 | <!-- default initialization is NULL node to match X3D specification --> |
| 154 | </field> |
| 155 |
<field name='normal' type='SFNode' accessType='inputOutput'
appinfo='Normal node only'> |
| 156 | <!-- default initialization is NULL node to match X3D specification --> |
| 157 | </field> |
| 158 |
<field name='texCoord' type='SFNode' accessType='inputOutput'
appinfo='TextureCoordinate node only'> |
| 159 | <!-- default initialization is NULL node to match X3D specification --> |
| 160 | </field> |
| 161 |
<field name='metadata' type='SFNode' accessType='inputOutput'
appinfo='Metadata node only'> |
| 162 | <!-- default initialization is NULL node to match X3D specification --> |
| 163 | </field> |
| 164 | </ProtoInterface> |
| 165 | <ProtoBody> |
| 166 |
<!-- IndexedFaceSet
RenderedITS is a DEF node that has 1 USE node: USE_1 -->
<IndexedFaceSet DEF='RenderedITS'> |
| 167 | <IS> |
| 168 | <connect nodeField='ccw' protoField='ccw'/> |
| 169 | <connect nodeField='normalPerVertex' protoField='normalPerVertex'/> |
| 170 | <connect nodeField='solid' protoField='solid'/> |
| 171 | <connect nodeField='color' protoField='color'/> |
| 172 | <connect nodeField='coord' protoField='coord'/> |
| 173 | <connect nodeField='normal' protoField='normal'/> |
| 174 | <connect nodeField='texCoord' protoField='texCoord'/> |
| 175 | </IS> |
| 176 | </IndexedFaceSet> |
| 177 | <Group DEF='UnrenderedITS'> |
| 178 | <Shape> |
| 179 | <!-- is this really needed at all?? --> |
| 180 |
<!-- IndexedFaceSet
NodesHolderITS is a DEF node that has 1 USE node: USE_1 -->
<IndexedFaceSet DEF='NodesHolderITS'> |
| 181 | <IS> |
| 182 | <connect nodeField='color' protoField='color'/> |
| 183 | <connect nodeField='coord' protoField='coord'/> |
| 184 | <connect nodeField='normal' protoField='normal'/> |
| 185 | <connect nodeField='texCoord' protoField='texCoord'/> |
| 186 | </IS> |
| 187 | </IndexedFaceSet> |
| 188 | </Shape> |
| 189 | <Script DEF='IndexedTriangleSetToIndexedFaceSet' directOutput='true'> |
| 190 | <field name='index' type='MFInt32' accessType='initializeOnly'/> |
| 191 | <field name='set_index' type='MFInt32' accessType='inputOnly'/> |
| 192 | <field name='renderedITS' type='SFNode' accessType='initializeOnly'> |
| 193 | <IndexedFaceSet USE='RenderedITS'/> |
| 194 | </field> |
| 195 | <field name='nodesHolder' type='SFNode' accessType='initializeOnly'> |
| 196 | <IndexedFaceSet USE='NodesHolderITS'/> |
| 197 | </field> |
| 198 | <field name='localTraceEnabled' type='SFBool' value='true' accessType='initializeOnly'/> |
| 199 | <field name='coordIndexNew' type='MFInt32' accessType='initializeOnly'> |
| 200 | <!-- constructed during initialization --> |
| 201 | </field> |
| 202 | <IS> |
| 203 | <connect nodeField='index' protoField='index'/> |
| 204 | <connect nodeField='set_index' protoField='set_index'/> |
| 205 | </IS> |
<![CDATA[
ecmascript:
function initialize()
{
// index is an array of triangle indices. The ordering of
// the vertices is ccw (counter-clockwise).
// ensure legal index values
for (ii=0; ii <= index.length-1; ii++)
{
if (index[ii] < -1)
{
alwaysPrint ('error, index[' + ii + ']=' + index[ii] +
' is illegal value');
return;
}
}
tracePrint ('index.length=' + index.length);
tracePrint ('index=' + index);
if (index.length < 3)
{
alwaysPrint ('warning, index.length=' + index.length +
' insufficient to construct a triangle, ITS ignored');
return;
}
coordIndexNew = new MFInt32 ();
// ii walks through index array,
// goal is to initialize coordIndexNew list to match triangles
for (ii=0; ii <= index.length-1; ii+=3)
{
if ((index[ii] == index[ii+1]) || (index[ii] == index[ii+2]) || (index[ii+1] == index[ii+2]))
{
alwaysPrint ('index=' + index);
alwaysPrint ('error, pair of equal indices in triangle');
return;
}
if (index[ii] >= 0)
{
// add another triangle from latest 3 points of fan set to ITS
// order is ccw, i.e. in correct halfplane direction
coordIndexNew [coordIndexNew.length] = index[ii];
coordIndexNew [coordIndexNew.length] = index[ii+1];
coordIndexNew [coordIndexNew.length] = index[ii+2];
coordIndexNew [coordIndexNew.length] = -1;
}
if (index.length % 3 != 0) {
alwaysPrint ('error, index field does not contain a multiple' +
'of three coordinate values.');
alwaysPrint ('The remaining vertices shall be ignored');
return;
}
// ensure done, or sufficient points remain to build another triangle
// if ( (i!=index.length-1) && (index.length - i < 2))
// {
// alwaysPrint ('index=' + index);
// alwaysPrint ('error, insufficient index values after' +
// 'index[' + i + ']=-1');
// return;
// }
// ensure done, or enough legal index values remain to build another triangle
// if ( (i!=index.length-1) &&
// ((index[i+1] == -1) || (index[i+2] == -1) || (index[i+3] == -1)))
// {
// alwaysPrint ('index=' + index);
// alwaysPrint ('error, insufficient non-negative-one index values after' +
// 'index[' + i + ']=-1');
// return;
// }
// incremental trace of array being built
tracePrint ('coordIndexNew=' + coordIndexNew);
}
renderedITS.coordIndex = coordIndexNew;
tracePrint ('renderedITS.coordIndex=' + renderedITS.coordIndex);
// match colorIndex if any Color node exists
if (nodesHolder.color)
{
if (nodesHolder.color.color.length > 0)
{
renderedITS.set_colorIndex = coordIndexNew;
tracePrint ('set_colorIndex=' + coordIndexNew);
}
}
}
function set_index (value, timestamp)
{
index = value;
initialize ();
}
function tracePrint(outputString)
{
if (localTraceEnabled)
Browser.println ('[IndexedTriangleSet]' + outputString);
}
function alwaysPrint(outputString)
{
Browser.println ('[IndexedTriangleSet]' + outputString);
}
]]>
|
|
| 207 | </Script> |
| 208 | <Group> |
| 209 | <MetadataString> |
| 210 | <IS> |
| 211 | <connect nodeField='metadata' protoField='metadata'/> |
| 212 | </IS> |
| 213 | </MetadataString> |
| 214 | </Group> |
| 215 | </Group> |
| 216 | </ProtoBody> |
| 217 | </ProtoDeclare> |
| 218 | <!-- ==================== --> |
| 219 | <ProtoDeclare name='IndexedTriangleStripSet' appinfo='IndexedTriangleStripSet represents a 3D shape composed of strips of triangles.'> |
| 220 | <ProtoInterface> |
| 221 | <field name='ccw' type='SFBool' value='true' accessType='initializeOnly'/> |
| 222 | <field name='colorPerVertex' type='SFBool' value='true' accessType='initializeOnly'/> |
| 223 | <field name='normalPerVertex' type='SFBool' value='true' accessType='initializeOnly'/> |
| 224 | <field name='solid' type='SFBool' value='true' accessType='initializeOnly'/> |
| 225 | <field name='set_index' type='MFInt32' accessType='inputOnly'/> |
| 226 | <field name='index' type='MFInt32' accessType='initializeOnly'> |
| 227 | <!-- default initialization is NULL array [] to match X3D specification --> |
| 228 | </field> |
| 229 |
<field name='color' type='SFNode' accessType='inputOutput'
appinfo='Color ColorRGBA node only'> |
| 230 | <!-- default initialization is NULL node to match X3D specification --> |
| 231 | </field> |
| 232 |
<field name='coord' type='SFNode' accessType='inputOutput'
appinfo='Coordinate node only'> |
| 233 | <!-- default initialization is NULL node to match X3D specification --> |
| 234 | </field> |
| 235 |
<field name='normal' type='SFNode' accessType='inputOutput'
appinfo='Normal node only'> |
| 236 | <!-- default initialization is NULL node to match X3D specification --> |
| 237 | </field> |
| 238 |
<field name='texCoord' type='SFNode' accessType='inputOutput'
appinfo='TextureCoordinate node only'> |
| 239 | <!-- default initialization is NULL node to match X3D specification --> |
| 240 | </field> |
| 241 |
<field name='metadata' type='SFNode' accessType='inputOutput'
appinfo='Metadata node only'> |
| 242 | <!-- default initialization is NULL node to match X3D specification --> |
| 243 | </field> |
| 244 | </ProtoInterface> |
| 245 | <ProtoBody> |
| 246 |
<!-- IndexedFaceSet
RenderedTSS is a DEF node that has 1 USE node: USE_1 -->
<IndexedFaceSet DEF='RenderedTSS'> |
| 247 | <IS> |
| 248 | <connect nodeField='ccw' protoField='ccw'/> |
| 249 | <connect nodeField='normalPerVertex' protoField='normalPerVertex'/> |
| 250 | <connect nodeField='solid' protoField='solid'/> |
| 251 | <connect nodeField='color' protoField='color'/> |
| 252 | <connect nodeField='coord' protoField='coord'/> |
| 253 | <connect nodeField='normal' protoField='normal'/> |
| 254 | <connect nodeField='texCoord' protoField='texCoord'/> |
| 255 | </IS> |
| 256 | </IndexedFaceSet> |
| 257 | <Group> |
| 258 | <Shape> |
| 259 | <!-- is this really needed at all?? --> |
| 260 |
<!-- IndexedFaceSet
NodesHolderTSS is a DEF node that has 1 USE node: USE_1 -->
<IndexedFaceSet DEF='NodesHolderTSS'> |
| 261 | <IS> |
| 262 | <connect nodeField='color' protoField='color'/> |
| 263 | <connect nodeField='coord' protoField='coord'/> |
| 264 | <connect nodeField='normal' protoField='normal'/> |
| 265 | <connect nodeField='texCoord' protoField='texCoord'/> |
| 266 | </IS> |
| 267 | </IndexedFaceSet> |
| 268 | </Shape> |
| 269 | <Script DEF='IndexedTriangleStripSetToIndexedFaceSet' directOutput='true'> |
| 270 | <field name='index' type='MFInt32' accessType='initializeOnly'/> |
| 271 | <field name='set_index' type='MFInt32' accessType='inputOnly'/> |
| 272 | <field name='renderedTSS' type='SFNode' accessType='initializeOnly'> |
| 273 | <IndexedFaceSet USE='RenderedTSS'/> |
| 274 | </field> |
| 275 | <field name='nodesHolder' type='SFNode' accessType='initializeOnly'> |
| 276 | <IndexedFaceSet USE='NodesHolderTSS'/> |
| 277 | </field> |
| 278 | <field name='localTraceEnabled' type='SFBool' value='true' accessType='initializeOnly'/> |
| 279 | <field name='coordIndexNew' type='MFInt32' accessType='initializeOnly'> |
| 280 | <!-- constructed during initialization --> |
| 281 | </field> |
| 282 | <IS> |
| 283 | <connect nodeField='index' protoField='index'/> |
| 284 | <connect nodeField='set_index' protoField='set_index'/> |
| 285 | </IS> |
<![CDATA[
ecmascript:
function initialize()
{
// index is an array of triangle indices. The ordering of
// the vertices is ccw (counter-clockwise).
// ensure legal index values
for (ii=0; ii <= index.length-1; ii++)
{
if (index[ii] < -1)
{
alwaysPrint ('error, index[' + ii + ']=' + index[ii] +
' is illegal value');
return;
}
}
tracePrint ('index.length=' + index.length);
tracePrint ('index=' + index);
if (index.length < 3)
{
alwaysPrint ('warning, index.length=' + index.length +
' insufficient to construct a triangle, ITS ignored');
return;
}
coordIndexNew = new MFInt32 ();
// ii walks through index array,
// goal is to initialize coordIndexNew list to match triangles
for (ii=2; ii <= index.length-1; ii++)
{
if ((index[ii] == index[ii-1]) || (index[ii] == index[ii-2]) || (index[ii-1] == index[ii-2]))
{
alwaysPrint ('index=' + index);
alwaysPrint ('error, pair of equal indices in triangle');
return;
}
if (index[ii] >= 0)
{
// add another triangle from latest 3 points of fan set to ITS
// order is ccw, i.e. in correct halfplane direction
coordIndexNew [coordIndexNew.length] = index[ii-2];
coordIndexNew [coordIndexNew.length] = index[ii-1];
coordIndexNew [coordIndexNew.length] = index[ii];
coordIndexNew [coordIndexNew.length] = -1;
}
// ensure done, or sufficient points remain to build another triangle
// if ( (i!=index.length-1) && (index.length - i < 2))
// {
// alwaysPrint ('index=' + index);
// alwaysPrint ('error, insufficient index values after' +
// 'index[' + i + ']=-1');
// return;
// }
// ensure done, or enough legal index values remain to build another triangle
// if ( (i!=index.length-1) &&
// ((index[i+1] == -1) || (index[i+2] == -1) || (index[i+3] == -1)))
// {
// alwaysPrint ('index=' + index);
// alwaysPrint ('error, insufficient non-negative-one index values after' +
// 'index[' + i + ']=-1');
// return;
// }
// incremental trace of array being built
tracePrint ('TSScoordIndexNew=' + coordIndexNew);
}
renderedTSS.set_coordIndex = coordIndexNew;
tracePrint ('renderedTSS.coordIndex=' + renderedTSS.coordIndex);
// match colorIndex if any Color node exists
if (nodesHolder.color)
{
if (nodesHolder.color.color.length > 0)
{
renderedTSS.set_colorIndex = coordIndexNew;
tracePrint ('set_colorIndex=' + coordIndexNew);
}
}
}
function set_index (value, timestamp)
{
index = value;
initialize ();
}
function tracePrint(outputString)
{
if (localTraceEnabled)
Browser.println ('[IndexedTriangleStripSet]' + outputString);
}
function alwaysPrint(outputString)
{
Browser.println ('[IndexedTriangleStripSet]' + outputString);
}
]]>
|
|
| 287 | </Script> |
| 288 | <Group> |
| 289 | <MetadataString> |
| 290 | <IS> |
| 291 | <connect nodeField='metadata' protoField='metadata'/> |
| 292 | </IS> |
| 293 | </MetadataString> |
| 294 | </Group> |
| 295 | </Group> |
| 296 | </ProtoBody> |
| 297 | </ProtoDeclare> |
| 298 | <!-- ==================== --> |
| 299 | <ProtoDeclare name='LineSet' appinfo='LineSet represents a 3D geometry formed by constructing polylines from 3D vertices.'> |
| 300 | <ProtoInterface> |
| 301 | <field name='vertexCount' type='MFInt32' accessType='inputOutput'> |
| 302 | <!-- default initialization is NULL array [] to match X3D specification --> |
| 303 | </field> |
| 304 |
<field name='color' type='SFNode' accessType='inputOutput'
appinfo='Color ColorRGBA node only'> |
| 305 | <!-- default initialization is NULL node to match X3D specification --> |
| 306 | </field> |
| 307 |
<field name='coord' type='SFNode' accessType='inputOutput'
appinfo='Coordinate node only'> |
| 308 | <!-- default initialization is NULL node to match X3D specification --> |
| 309 | </field> |
| 310 |
<field name='metadata' type='SFNode' accessType='inputOutput'
appinfo='Metadata node only'> |
| 311 | <!-- default initialization is NULL node to match X3D specification --> |
| 312 | </field> |
| 313 | </ProtoInterface> |
| 314 | <ProtoBody> |
| 315 |
<!-- IndexedLineSet
RenderedILS is a DEF node that has 1 USE node: USE_1 -->
<IndexedLineSet DEF='RenderedILS'> |
| 316 | <IS> |
| 317 | <connect nodeField='color' protoField='color'/> |
| 318 | </IS> |
| 319 | </IndexedLineSet> |
| 320 | <Group> |
| 321 | <Shape> |
| 322 |
<!-- IndexedLineSet
NodesHolderILS is a DEF node that has 1 USE node: USE_1 -->
<IndexedLineSet DEF='NodesHolderILS'> |
| 323 | <IS> |
| 324 | <connect nodeField='color' protoField='color'/> |
| 325 | <connect nodeField='coord' protoField='coord'/> |
| 326 | </IS> |
| 327 | </IndexedLineSet> |
| 328 | <Appearance DEF='UnusedAppearance'> |
| 329 | <Material emissiveColor='0.8 0.8 0.8'/> |
| 330 | </Appearance> |
| 331 | </Shape> |
| 332 | <Script DEF='LineSetToIndexedLineSet' directOutput='true'> |
| 333 | <field name='vertexCount' type='MFInt32' accessType='inputOutput'> |
| 334 | <!-- default initialization is NULL array [] to match X3D specification --> |
| 335 | </field> |
| 336 | <field name='renderedILS' type='SFNode' accessType='initializeOnly'> |
| 337 | <IndexedLineSet USE='RenderedILS'/> |
| 338 | </field> |
| 339 | <field name='nodesHolder' type='SFNode' accessType='initializeOnly'> |
| 340 | <IndexedLineSet USE='NodesHolderILS'/> |
| 341 | </field> |
| 342 | <field name='localTraceEnabled' type='SFBool' value='true' accessType='initializeOnly'/> |
| 343 | <field name='coordIndexNew' type='MFInt32' accessType='initializeOnly'> |
| 344 | <!-- constructed during initialization --> |
| 345 | </field> |
| 346 | <IS> |
| 347 | <connect nodeField='vertexCount' protoField='vertexCount'/> |
| 348 | </IS> |
<![CDATA[
ecmascript:
function initialize()
{
vertexCountSum = 0;
tracePrint ('vertexCount=' + vertexCount);
for (i=0; i < vertexCount.length; i++)
{
if (vertexCount[i] < 2)
{
alwaysPrint ('error, vertexCount[' + i + ']=' + vertexCount[i] +
' is illegal value, must be >= 2');
return;
}
vertexCountSum = vertexCountSum + vertexCountSum[i];
}
tracePrint ('vertexCountSum=' + vertexCountSum);
numberPoints = nodesHolder.coord.point.length;
if (numberPoints < vertexCountSum)
{
alwaysPrint ('warning, Coordinate.point.length=' + numberPoints +
' is less than vertexCountSum=' + vertexCountSum + ', LS ignored');
return;
}
coordIndexNew = new MFInt32 ();
numberSegments = vertexCountSum.length; // need validity check
// i walks through array of points to build line-segment indices
i = 0;
for (seg=0; seg < numberSegments; seg++)
{
for (j=0; j < vertexCount[seg]; j++)
{
coordIndexNew [coordIndexNew.length] = i;
i++;
}
coordIndexNew [coordIndexNew.length] = -1; // terminate current fan
// incremental trace of array being built
tracePrint ('coordIndexNew=' + coordIndexNew);
} // repeat for all vertices
renderedILS.coordIndex = coordIndexNew;
tracePrint ('renderedILS.coordIndex=' + renderedILS.coordIndex);
// match colorIndex if any Color node exists
if (nodesHolder.color)
{
if (nodesHolder.color.color.length > 0)
{
renderedILS.colorIndex = coordIndexNew;
tracePrint ('set_colorIndex=' + coordIndexNew);
}
}
}
function tracePrint(outputString)
{
if (localTraceEnabled)
Browser.println ('[TriangleFanSet]' + outputString);
}
function alwaysPrint(outputString)
{
Browser.println ('[TriangleFanSet]' + outputString);
}
]]>
|
|
| 350 | </Script> |
| 351 | <Group> |
| 352 | <MetadataString> |
| 353 | <IS> |
| 354 | <connect nodeField='metadata' protoField='metadata'/> |
| 355 | </IS> |
| 356 | </MetadataString> |
| 357 | </Group> |
| 358 | </Group> |
| 359 | </ProtoBody> |
| 360 | </ProtoDeclare> |
| 361 | <!-- ==================== --> |
| 362 | <ProtoDeclare name='TriangleFanSet' appinfo='TriangleFanSet represents a 3D shape composed of triangles that form a fan shape around the first vertex declared in each fan.'> |
| 363 | <ProtoInterface> |
| 364 | <field name='fanCount' type='MFInt32' accessType='inputOutput'> |
| 365 | <!-- default initialization is NULL array [] to match X3D specification --> |
| 366 | </field> |
| 367 | <field name='ccw' type='SFBool' value='true' accessType='initializeOnly'/> |
| 368 | <field name='colorPerVertex' type='SFBool' value='true' accessType='initializeOnly'/> |
| 369 | <field name='normalPerVertex' type='SFBool' value='true' accessType='initializeOnly'/> |
| 370 | <field name='solid' type='SFBool' value='true' accessType='initializeOnly'/> |
| 371 |
<field name='color' type='SFNode' accessType='inputOutput'
appinfo='Color ColorRGBA node only'> |
| 372 | <!-- default initialization is NULL node to match X3D specification --> |
| 373 | </field> |
| 374 |
<field name='coord' type='SFNode' accessType='inputOutput'
appinfo='Coordinate node only'> |
| 375 | <!-- default initialization is NULL node to match X3D specification --> |
| 376 | </field> |
| 377 |
<field name='normal' type='SFNode' accessType='inputOutput'
appinfo='Normal node only'> |
| 378 | <!-- default initialization is NULL node to match X3D specification --> |
| 379 | </field> |
| 380 |
<field name='texCoord' type='SFNode' accessType='inputOutput'
appinfo='TextureCoordinate node only'> |
| 381 | <!-- default initialization is NULL node to match X3D specification --> |
| 382 | </field> |
| 383 |
<field name='metadata' type='SFNode' accessType='inputOutput'
appinfo='Metadata node only'> |
| 384 | <!-- default initialization is NULL node to match X3D specification --> |
| 385 | </field> |
| 386 | </ProtoInterface> |
| 387 | <ProtoBody> |
| 388 |
<!-- IndexedFaceSet
RenderedTFS is a DEF node that has 1 USE node: USE_1 -->
<IndexedFaceSet DEF='RenderedTFS'> |
| 389 | <IS> |
| 390 | <connect nodeField='ccw' protoField='ccw'/> |
| 391 | <connect nodeField='colorPerVertex' protoField='colorPerVertex'/> |
| 392 | <connect nodeField='normalPerVertex' protoField='normalPerVertex'/> |
| 393 | <connect nodeField='solid' protoField='solid'/> |
| 394 | <connect nodeField='color' protoField='color'/> |
| 395 | <connect nodeField='coord' protoField='coord'/> |
| 396 | <connect nodeField='normal' protoField='normal'/> |
| 397 | <connect nodeField='texCoord' protoField='texCoord'/> |
| 398 | </IS> |
| 399 | </IndexedFaceSet> |
| 400 | <Group DEF='UnrenderedTFS'> |
| 401 | <Shape> |
| 402 | <!-- is this really needed at all?? --> |
| 403 |
<!-- IndexedFaceSet
NodesHolderTFS is a DEF node that has 1 USE node: USE_1 -->
<IndexedFaceSet DEF='NodesHolderTFS'> |
| 404 | <IS> |
| 405 | <connect nodeField='color' protoField='color'/> |
| 406 | <connect nodeField='coord' protoField='coord'/> |
| 407 | <connect nodeField='normal' protoField='normal'/> |
| 408 | <connect nodeField='texCoord' protoField='texCoord'/> |
| 409 | </IS> |
| 410 | </IndexedFaceSet> |
| 411 | </Shape> |
| 412 | <Script DEF='TriangleFanSetToIndexedFaceSet' directOutput='true'> |
| 413 | <field name='fanCount' type='MFInt32' accessType='inputOutput'> |
| 414 | <!-- default initialization is NULL array [] to match X3D specification --> |
| 415 | </field> |
| 416 | <field name='renderedTFS' type='SFNode' accessType='initializeOnly'> |
| 417 | <IndexedFaceSet USE='RenderedTFS'/> |
| 418 | </field> |
| 419 | <field name='nodesHolder' type='SFNode' accessType='initializeOnly'> |
| 420 | <IndexedFaceSet USE='NodesHolderTFS'/> |
| 421 | </field> |
| 422 | <field name='localTraceEnabled' type='SFBool' value='true' accessType='initializeOnly'/> |
| 423 | <field name='coordIndexNew' type='MFInt32' accessType='initializeOnly'> |
| 424 | <!-- constructed during initialization --> |
| 425 | </field> |
| 426 | <IS> |
| 427 | <connect nodeField='fanCount' protoField='fanCount'/> |
| 428 | </IS> |
<![CDATA[
ecmascript:
function initialize()
{
fanCountSum = 0;
tracePrint ('fanCount=' + fanCount);
for (i=0; i < fanCount.length; i++)
{
if (fanCount[i] < 3)
{
alwaysPrint ('error, fanCount[' + i + ']=' + fanCount[i] +
' is illegal value, must be >= 3');
return;
}
fanCountSum = fanCountSum + fanCount[i];
}
tracePrint ('fanCountSum=' + fanCountSum);
numberPoints = nodesHolder.coord.point.length;
if (numberPoints < fanCountSum)
{
alwaysPrint ('warning, Coordinate.point.length=' + numberPoints +
' is less than fanCountSum=' + fanCountSum + ', TFS ignored');
return;
}
coordIndexNew = new MFInt32 ();
numberFans = fanCount.length; // need validity check
// i walks through array of points to build polygon indices
i = 0;
for (fan=0; fan < numberFans; fan++)
{
for (j=0; j < fanCount[fan]; j++)
{
coordIndexNew [coordIndexNew.length] = i;
i++;
}
coordIndexNew [coordIndexNew.length] = -1; // terminate current fan
// incremental trace of array being built
tracePrint ('coordIndexNew=' + coordIndexNew);
} // repeat for all fans
renderedTFS.coordIndex = coordIndexNew;
tracePrint ('renderedTFS.coordIndex=' + renderedTFS.coordIndex);
// match colorIndex if any Color node exists
if (nodesHolder.color)
{
if (nodesHolder.color.color.length > 0)
{
renderedTFS.set_colorIndex = coordIndexNew;
tracePrint ('set_colorIndex=' + coordIndexNew);
}
}
}
function tracePrint(outputString)
{
if (localTraceEnabled)
Browser.println ('[TriangleFanSet]' + outputString);
}
function alwaysPrint(outputString)
{
Browser.println ('[TriangleFanSet]' + outputString);
}
]]>
|
|
| 430 | </Script> |
| 431 | <Group> |
| 432 | <MetadataString> |
| 433 | <IS> |
| 434 | <connect nodeField='metadata' protoField='metadata'/> |
| 435 | </IS> |
| 436 | </MetadataString> |
| 437 | </Group> |
| 438 | </Group> |
| 439 | </ProtoBody> |
| 440 | </ProtoDeclare> |
| 441 | <!-- ==================== --> |
| 442 | <ProtoDeclare name='TriangleSet' appinfo='TriangleSet represents a 3D shape that represents a collection of individual triangles.'> |
| 443 | <ProtoInterface> |
| 444 | <field name='ccw' type='SFBool' value='true' accessType='initializeOnly'/> |
| 445 | <field name='colorPerVertex' type='SFBool' value='true' accessType='initializeOnly'/> |
| 446 | <field name='normalPerVertex' type='SFBool' value='true' accessType='initializeOnly'/> |
| 447 | <field name='solid' type='SFBool' value='true' accessType='initializeOnly'/> |
| 448 |
<field name='color' type='SFNode' accessType='inputOutput'
appinfo='Color ColorRGBA node only'> |
| 449 | <!-- default initialization is NULL node to match X3D specification --> |
| 450 | </field> |
| 451 |
<field name='coord' type='SFNode' accessType='inputOutput'
appinfo='Coordinate node only'> |
| 452 | <!-- default initialization is NULL node to match X3D specification --> |
| 453 | </field> |
| 454 |
<field name='normal' type='SFNode' accessType='inputOutput'
appinfo='Normal node only'> |
| 455 | <!-- default initialization is NULL node to match X3D specification --> |
| 456 | </field> |
| 457 |
<field name='texCoord' type='SFNode' accessType='inputOutput'
appinfo='TextureCoordinate node only'> |
| 458 | <!-- default initialization is NULL node to match X3D specification --> |
| 459 | </field> |
| 460 |
<field name='metadata' type='SFNode' accessType='inputOutput'
appinfo='Metadata node only'> |
| 461 | <!-- default initialization is NULL node to match X3D specification --> |
| 462 | </field> |
| 463 | </ProtoInterface> |
| 464 | <ProtoBody> |
| 465 |
<!-- IndexedFaceSet
RenderedTS is a DEF node that has 1 USE node: USE_1 -->
<IndexedFaceSet DEF='RenderedTS'> |
| 466 | <IS> |
| 467 | <connect nodeField='ccw' protoField='ccw'/> |
| 468 | <connect nodeField='normalPerVertex' protoField='normalPerVertex'/> |
| 469 | <connect nodeField='solid' protoField='solid'/> |
| 470 | <connect nodeField='color' protoField='color'/> |
| 471 | <connect nodeField='coord' protoField='coord'/> |
| 472 | <connect nodeField='normal' protoField='normal'/> |
| 473 | <connect nodeField='texCoord' protoField='texCoord'/> |
| 474 | </IS> |
| 475 | </IndexedFaceSet> |
| 476 | <Group DEF='UnrenderedTS'> |
| 477 | <Shape> |
| 478 | <!-- is this really needed at all?? --> |
| 479 |
<!-- IndexedFaceSet
NodesHolderTS is a DEF node that has 1 USE node: USE_1 -->
<IndexedFaceSet DEF='NodesHolderTS'> |
| 480 | <IS> |
| 481 | <connect nodeField='color' protoField='color'/> |
| 482 | <connect nodeField='coord' protoField='coord'/> |
| 483 | <connect nodeField='normal' protoField='normal'/> |
| 484 | <connect nodeField='texCoord' protoField='texCoord'/> |
| 485 | </IS> |
| 486 | </IndexedFaceSet> |
| 487 | </Shape> |
| 488 | <Script DEF='TriangleSetToIndexedFaceSet' directOutput='true'> |
| 489 | <field name='index' type='MFInt32' accessType='initializeOnly'> |
| 490 | <!-- default initialization is NULL --> |
| 491 | </field> |
| 492 | <field name='set_index' type='MFInt32' accessType='inputOnly'/> |
| 493 | <field name='renderedTS' type='SFNode' accessType='initializeOnly'> |
| 494 | <IndexedFaceSet USE='RenderedTS'/> |
| 495 | </field> |
| 496 | <field name='nodesHolder' type='SFNode' accessType='initializeOnly'> |
| 497 | <IndexedFaceSet USE='NodesHolderTS'/> |
| 498 | </field> |
| 499 | <field name='localTraceEnabled' type='SFBool' value='true' accessType='initializeOnly'/> |
| 500 | <field name='coordIndexNew' type='MFInt32' accessType='initializeOnly'> |
| 501 | <!-- constructed during initialization --> |
| 502 | </field> |
<![CDATA[
ecmascript:
function initialize()
{
// index is an array of triangle indices. The ordering of
// the vertices is ccw (counter-clockwise).
// ensure legal index values
for (ii=0; ii <= index.length-1; ii++)
{
if (index[ii] < -1)
{
alwaysPrint ('error, index[' + ii + ']=' + index[ii] +
' is illegal value');
return;
}
}
tracePrint ('index.length=' + index.length);
tracePrint ('index=' + index);
if (index.length < 3)
{
alwaysPrint ('warning, index.length=' + index.length +
' insufficient to construct a triangle, ITS ignored');
return;
}
coordIndexNew = new MFInt32 ();
// ii walks through index array,
// goal is to initialize coordIndexNew list to match triangles
for (ii=0; ii <= index.length-1; ii+=3)
{
if ((index[ii] == index[ii+1]) || (index[ii] == index[ii+2]) || (index[ii+1] == index[ii+2]))
{
alwaysPrint ('index=' + index);
alwaysPrint ('error, pair of equal indices in triangle');
return;
}
if (index[ii] >= 0)
{
// add another triangle from latest 3 points of fan set to ITS
// order is ccw, i.e. in correct halfplane direction
coordIndexNew [coordIndexNew.length] = index[ii];
coordIndexNew [coordIndexNew.length] = index[ii+1];
coordIndexNew [coordIndexNew.length] = index[ii+2];
coordIndexNew [coordIndexNew.length] = -1;
}
if (index.length % 3 != 0) {
alwaysPrint ('error, index field does not contain a multiple' +
'of three coordinate values.');
alwaysPrint ('The remaining vertices shall be ignored');
return;
}
// ensure done, or sufficient points remain to build another triangle
// if ( (i!=index.length-1) && (index.length - i < 2))
// {
// alwaysPrint ('index=' + index);
// alwaysPrint ('error, insufficient index values after' +
// 'index[' + i + ']=-1');
// return;
// }
// ensure done, or enough legal index values remain to build another triangle
// if ( (i!=index.length-1) &&
// ((index[i+1] == -1) || (index[i+2] == -1) || (index[i+3] == -1)))
// {
// alwaysPrint ('index=' + index);
// alwaysPrint ('error, insufficient non-negative-one index values after' +
// 'index[' + i + ']=-1');
// return;
// }
// incremental trace of array being built
tracePrint ('coordIndexNew=' + coordIndexNew);
}
renderedITS.set_coordIndex = coordIndexNew;
tracePrint ('renderedITS.coordIndex=' + renderedITS.coordIndex);
// match colorIndex if any Color node exists
if (nodesHolder.color)
{
if (nodesHolder.color.color.length > 0)
{
renderedITS.set_colorIndex = coordIndexNew;
tracePrint ('set_colorIndex=' + coordIndexNew);
}
}
}
function set_index (value, timestamp)
{
index = value;
initialize ();
}
function tracePrint(outputString)
{
if (localTraceEnabled)
Browser.println ('[IndexedTriangleSet]' + outputString);
}
function alwaysPrint(outputString)
{
Browser.println ('[IndexedTriangleSet]' + outputString);
}
]]>
|
|
| 504 | </Script> |
| 505 | <Group> |
| 506 | <MetadataString> |
| 507 | <IS> |
| 508 | <connect nodeField='metadata' protoField='metadata'/> |
| 509 | </IS> |
| 510 | </MetadataString> |
| 511 | </Group> |
| 512 | </Group> |
| 513 | </ProtoBody> |
| 514 | </ProtoDeclare> |
| 515 | <!-- ==================== --> |
| 516 | <ProtoDeclare name='TriangleStripSet' appinfo='TriangleStripSet represents a 3D shape composed of strips of triangles.'> |
| 517 | <ProtoInterface> |
| 518 | <field name='stripCount' type='MFInt32' accessType='inputOutput'> |
| 519 | <!-- default initialization is NULL array [] to match X3D specification --> |
| 520 | </field> |
| 521 | <field name='ccw' type='SFBool' value='true' accessType='initializeOnly'/> |
| 522 | <field name='colorPerVertex' type='SFBool' value='true' accessType='initializeOnly'/> |
| 523 | <field name='normalPerVertex' type='SFBool' value='true' accessType='initializeOnly'/> |
| 524 | <field name='solid' type='SFBool' value='true' accessType='initializeOnly'/> |
| 525 |
<field name='color' type='SFNode' accessType='inputOutput'
appinfo='Color ColorRGBA node only'> |
| 526 | <!-- default initialization is NULL node to match X3D specification --> |
| 527 | </field> |
| 528 |
<field name='coord' type='SFNode' accessType='inputOutput'
appinfo='Coordinate node only'> |
| 529 | <!-- default initialization is NULL node to match X3D specification --> |
| 530 | </field> |
| 531 |
<field name='normal' type='SFNode' accessType='inputOutput'
appinfo='Normal node only'> |
| 532 | <!-- default initialization is NULL node to match X3D specification --> |
| 533 | </field> |
| 534 |
<field name='texCoord' type='SFNode' accessType='inputOutput'
appinfo='TextureCoordinate node only'> |
| 535 | <!-- default initialization is NULL node to match X3D specification --> |
| 536 | </field> |
| 537 |
<field name='metadata' type='SFNode' accessType='inputOutput'
appinfo='Metadata node only'> |
| 538 | <!-- default initialization is NULL node to match X3D specification --> |
| 539 | </field> |
| 540 | </ProtoInterface> |
| 541 | <ProtoBody> |
| 542 | <IndexedFaceSet/> |
| 543 | </ProtoBody> |
| 544 | </ProtoDeclare> |
| 545 | <!-- ==================== --> |
| 546 | <!-- ProtoInstance examples are found in RenderingComponentExamples.x3d --> |
| 547 | <Background groundColor='0.2 0.2 0.2' skyColor='0.2 0.2 0.2'/> |
| 548 | <Anchor DEF='LinkToExamples' description='link to examples' url=' "RenderingComponentExamples.x3d" "https://www.web3d.org/x3d/content/examples/Basic/development/RenderingComponentExamples.x3d" "RenderingComponentExamples.wrl" "https://www.web3d.org/x3d/content/examples/Basic/development/RenderingComponentExamples.wrl" '> |
| 549 | <Shape> |
| 550 | <Appearance> |
| 551 | <Material diffuseColor='1 1 1'/> |
| 552 | </Appearance> |
| 553 | <Text string='"RenderingComponentPrototypes" "is a developmental file." "Click this text to view" "RenderingComponentExamples"'> |
| 554 | <FontStyle justify='"MIDDLE" "MIDDLE"'/> |
| 555 | </Text> |
| 556 | </Shape> |
| 557 | <!-- Selectable Text has transparent Box and TouchSensor description as a tooltip --> |
| 558 | <Shape> |
| 559 | <Box size='12 5 .001'/> |
| 560 | <Appearance> |
| 561 | <Material transparency='0.8'/> |
| 562 | </Appearance> |
| 563 | </Shape> |
| 564 | </Anchor> |
| 565 | </Scene> |
| 566 | </X3D> |
Event Graph ROUTE Table with 0 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.
|
ConvertColorRGBAtoRGB
Script |
No direct ROUTE connection found for events to/from this node. Contains SFNode fields with direct access to another node. |
|
IndexedTriangleFanSetToIndexedFaceSet
Script |
No direct ROUTE connection found for events to/from this node. Contains SFNode fields with direct access to another node. |
|
IndexedTriangleSetToIndexedFaceSet
Script |
No direct ROUTE connection found for events to/from this node. Contains SFNode fields with direct access to another node. |
|
IndexedTriangleStripSetToIndexedFaceSet
Script |
No direct ROUTE connection found for events to/from this node. Contains SFNode fields with direct access to another node. |
|
LineSetToIndexedLineSet
Script |
No direct ROUTE connection found for events to/from this node. Contains SFNode fields with direct access to another node. |
|
TriangleFanSetToIndexedFaceSet
Script |
No direct ROUTE connection found for events to/from this node. Contains SFNode fields with direct access to another node. |
|
TriangleSetToIndexedFaceSet
Script |
No direct ROUTE connection found for events to/from this node. Contains SFNode fields with direct access to another node. |
|
LinkToExamples
Anchor |
description='link to examples' User-interaction hint for this node. |
<!--
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)
<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.
-->