| Home | zeGraph lib | Lua lib | Custom lib | Tutorials | Notes | XML Script | C-Talk | Z-Script |
Graph
   axis
   blend
   color
   color bar
   fog
   freetype
   light
   line
   material
   node
   point
   plot
   polygon
   render
   scene
   stencil
   texcoord
   text
   texture
   vertex
Utility
   array
   bio
   hdf
   make
   math
   netcdf
Auxiliary
   curl
   expact
   sqlite
   window

zeLine

Use .new("line") to create the object. It is one of the shape objects that the OpenGL display list is implemented. A line object will be compiled into a display list if activated by the render. By default the object is treated as GL_LINE_STRIP with line width of one and style of solid. Improperly setting the line type is the most misuse of the object. When the rendered result is not what you anticipated, check the call object:set{type="?"}. The order of callig translate, scale, and rotate functions matters.

:rotatex(angle)
:rotatey(angle)
:rotatez(angle)

These functions rotate the object around the x-, y- and z-axis, respectively. The calling order matters.

:reset()

Resets transformations to none.

:scale(xs, ys, zs)

Scales the object in x, y, and z direction for the factors of xs, ys, and zs.

:translate(dx, dy, dz)

Moves the object dx, dy, and dz away from the current position.

:update()

Forces to update rendering of the object. It should be used when the data of vertex are changed after a rendering with the displaylist enabled.

:set{...}

Sets line properties with a Lua table. Valid key-value pairs in the Lua table are listed as follows.

Key Value Type Remark
color {r, g, b, a} Numbers (0 to 1) in table Sets the line color when no vertex color object is used or the vertex color object contains no data.
type lines String Instructs the line that its vertex object contains data of lines (GL_LINES).
  loop String Instructs the line that its vertex object contains data of line loop (GL_LINE_LOOP).
  strip String Instructs the line that its vertex object contains data of line segments (GL_LINE_STRIP).
solid width Number(>0) Sets the line style as solid of the specified width
dot {factor, size} Numbers in table Sets the line style as dot of the specified size. The factor determines length to width ratio of a dot.
dash {factor, width} Numbers in table Sets the line style as dash of the specified width. The factor determines length to with ratio.
dotdash {factor, width} Numbers in table Set the line style as dotdash of the specified width. The factor determines length to with ratio.
smooth flag Boolean If true, produces smooth (antialias) line. Blending should be used with this option.
enable flag Boolean Enables (default) and disables the object
vertex obj zeVertex Sets the vertex object.
vertex_normal obj zeVertex Sets the vertex normal object.
vertex_color obj zeColor Sets the vertex color object.