Post

IndexedLineSet

IndexedLineSet

Overview

IndexedLineSet defines polyline segments using index lists corresponding to vertex coordinates. IndexedLineSet is a geometry node that can contain a Coordinate or CoordinateDouble node and optionally a Color or ColorRGBA node.

The IndexedLineSet node belongs to the Rendering component and requires at least level 1, its default container field is geometry. It is available since VRML 2.0 and from X3D version 3.0 or higher.

Hierarchy

1
2
3
+ X3DNode
  + X3DGeometryNode
    + IndexedLineSet

Fields

SFNode [in, out] metadata NULL [X3DMetadataObject]

Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.

Hint

MFInt32 [in] set_colorIndex [0,∞) or -1

colorIndex values define the order in which Color or ColorRGBA values are applied to polygons (or vertices), interspersed by -1 if colorlPerVertex=true.

Hints

  • If colorIndex array is not provided, then Color or ColorRGBA values are indexed according to the coordIndex field.
  • If colorPerVertex=’false’ then one index is provided for each polygon defined by the coordIndex array. No sentinel -1 values are included.
  • If colorPerVertex=’true’ then a matching set of indices is provided, each separated by sentinel -1, that exactly corresponds to individual values in the coordIndex array polygon definitions. Omitting duplicative colorIndex fields can reduce file size.
  • This field is not accessType inputOutput since X3D browsers might use different underlying geometric representations for high-performance rendering, and so output events are not appropriate.

Warning

  • It is an error to define this transient inputOnly field in an X3D file, instead only use it a destination for ROUTE events.

MFInt32 [in] set_coordIndex [0,∞) or -1

coordIndex indices provide the order in which coordinates are applied to construct each polyline. Order starts at index 0, commas are optional between sets.

Hints

  • Sentinel value -1 is used to separate indices for each successive polyline.
  • This field is not accessType inputOutput since X3D browsers might use different underlying geometric representations for high-performance rendering, and so output events are not appropriate.

Warning

  • It is an error to define this transient inputOnly field in an X3D file, instead only use it a destination for ROUTE events.

SFBool [ ] colorPerVertex TRUE

Whether Color node color values are applied to each point vertex (true) or per polyline (false).

Hint

MFInt32 [ ] colorIndex [ ] [0,∞) or -1

colorIndex values define the order in which Color or ColorRGBA values are applied to polygons (or vertices), interspersed by -1 if colorlPerVertex=true.

Hints

  • If colorIndex array is not provided, then Color or ColorRGBA values are indexed according to the coordIndex field. Omitting duplicative colorIndex fields can reduce file size.
  • If colorPerVertex=’false’ then one index is provided for each polygon defined by the coordIndex array. No sentinel -1 values are included.
  • If colorPerVertex=’true’ then a matching set of indices is provided, each separated by sentinel -1, that exactly corresponds to individual values in the coordIndex array polygon definitions.
  • If rendering Coordinate points originally defined for an IndexedFaceSet, index values may need to repeat initial each initial vertex to close the polygons.

Warning

  • If child Color or ColorRGBA node is not provided, then geometry is rendered using corresponding Appearance and material/texture values.

MFInt32 [ ] coordIndex [ ] [0,∞) or -1

coordIndex indices provide the order in which coordinates are applied to construct each polygon face. Order starts at index 0, commas are optional between sets, use -1 to separate indices for each polyline.

Hints

  • If rendering Coordinate points originally defined for an IndexedFaceSet, index values may need to repeat initial each initial vertex to close the polygons.
  • Sentinel value -1 is used to separate indices for each successive polyline.

Warning

  • coordIndex is required in order to connect contained coordinate point values.

MFNode [in, out] attrib [ ] [X3DVertexAttributeNode]

Single contained FloatVertexAttribute node that can specify list of per-vertex attribute information for programmable shaders.

Hint

SFNode [in, out] fogCoord NULL [FogCoordinate]

Single contained FogCoordinate node that can specify depth parameters for fog in corresponding geometry.

SFNode [in, out] color NULL [X3DColorNode]

Single contained Color or ColorRGBA node that can specify color values applied to corresponding vertices according to colorIndex and colorPerVertex fields.

SFNode [in, out] tangent NULL [Tangent] non standard

Input/Output field tangent. If there is no Tangent node, the MikkTSpace algorithm is used to generate tangent vectors.

SFNode [in, out] normal NULL [X3DNormalNode]

Single contained Normal node that can specify perpendicular vectors for corresponding vertices to support rendering computations, applied according to the normalPerVertex field.

Hint

  • Useful for special effects. Normal vector computation by 3D graphics hardware is quite fast so adding normals to a scene is typically unnecessary.

Warning

  • normal vectors increase file size, typically doubling geometry definitions. Normal vectors are rapidly computed at run time by GPUs and thus are rarely needed in model files if no special effects are expected.

SFNode [in, out] coord NULL [X3DCoordinateNode]

Single contained Coordinate or CoordinateDouble node that can specify a list of vertex values.

Advice

Hints

  • Polygonal chain
  • Either values in a contained Color node, or else Material emissiveColor in corresponding Appearance node, are used for rendering lines and points.
  • Adding LineProperties to the corresponding Appearance node can modify the rendering style of these lines.
  • If rendering Coordinate points originally defined for an IndexedFaceSet, index values may need to repeat each initial vertex to close each polygon outline.
  • Step-wise variation or linear interpolation of color values can be used as a good scientific visualization technique to map arbitrary function values to a color map.
  • Insert a Shape node before adding geometry or Appearance.
  • For advanced extensibility, authors can substitute a type-matched ProtoInstance node (with correct containerField value) for contained node content.
  • Consider including Fog (with Fog color matching Background color) to provide further depth cueing for IndexedLineSet (ILS).

Warnings

  • Lines are not lit, are not texture-mapped, and do not participate in collision detection.
  • Use a different color (or Material emissiveColor) than the Background color, otherwise geometry is invisible.

Example

See Also

This post is licensed under CC BY 4.0 by the author.