5.31. Line (media-object)

<line> ‐ A geometrical line

5.31.1. Attributes

NameTypeDefaults
idIDNone (required)
x1FLOAT0.0
y1FLOAT0.0
z1FLOAT0.0
x2FLOAT0.0
y2FLOAT0.0
z2FLOAT0.0
r1FLOAT1.0
g1FLOAT1.0
b1FLOAT1.0
a1FLOAT1.0
r2FLOAT1.0
g2FLOAT1.0
b2FLOAT1.0
a2FLOAT1.0
widthFLOAT1.0

5.31.2. Description

This element defines a line.

The float values of the x1, y1, z1, x2, y2, and z2 attributes define the coordinates of the two line end points. The float values of the r1, g1, b1, a1, r2, g2, b2, and a2 attributes define the colors of the two line end points. The float value of the width attribute defines the width (in pixels) of the line (should be between 0.5 and 10.0).

5.31.3. Expected children

None.

5.31.4. Example

The example below defines a red to blue line that is 4-pixel wide.

<node id="line">
  <line id="line"  
        x1="0.0" y1="0.0" z1="0.0" x2="10.0" y2="10.0" z2="10.0" 
        r1="1.0" g1="0.0" b1="0.0" r2="0.0" g2="0.0" b2="1.0"  
        width="4"/>
</node>