X3D.IndexedTriangleSet
from Node Reference
<IndexedTriangleSet> node
parent: Shape node (geometry field)
attributes:
- DEF: SFString
- USE: SFString
- index: MFInt32
- ccw: "true|false"
- colorPerVertex: "true|false"
- normalPerVertex: "true|false"
- solid: "true|false"
- containerField="geometry"
children:
- coord: Coordinate? (1)
- attrib: VertexAttributes?
- color: Color? (0-1)
- texCoord: TextureCoordinate? (0-1)
- normal: Normal? (0-1)
example:
<IndexedTriangleSet index="0 1 2"> <Coordinate point="1 2 3 3 2 1 5 6 7"/> </IndexedTriangleSet>
notes:
The index field is used to specify vertex indices (not individual coordinate indices). In order to specify a single triangle, 3 indices are required, which index into the <Coordinate> node's vertex values in sets of 3 (which are specified in it's point attribute). In the example above, the first index ("0") indexes the first vertex in the point list, which is itself defined by the first 3 listed coordinate values (x y z = "1 2 3"). The coordinates of the second indexed vertex ("1" in the index field, is found in the point list at (zero-based) positions 3, 4 and 5 (with values "3 2 1").
If normalPerVertex is true, the normal at each vertex shall be the average of the normals for all triangles that share that vertex, while if normalPerVertex is false, the normal at each vertex shall be perpendicular to the face for that triangle.
See also