| 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

zeRender

Use .new("render") to create the object. It initializes OpenGL rendering engine, and determines the image size and the background color. The default image size is 512 by 512.

:add(object[, object, ...])

Adds any numbers of scene objects to the render.

:towindow(handle[, flag])

Renders image to the window indentified by the handle. If the flag is none zero, it enables OpenGL display list in rendering objects of zePoint, zeLine, and zePolygon.

:tofile(fname[, flag])

Renders image to a file. If the flag is none zero, it enables OpenGL display list in rendering objects of zePoint, zeLine, and zePolygon. Using the display list improves performance when changes in a series of rendering is trivial or involves only transformations.

:toavi([fname, ms])

Renders image to a AVI movie with the frame rate of ms miniseconds (default = 1000). If the file name is specified, a new AVI file will be created; otherwise the function adds image to a previously opened file.

:totexture(object[, alpha])

Renders the scene to the texture object. The image width and hight must be the power of two. The alpha channel is zero when the mean of red, green and blue equals the specified alpha value; otherwize is 255.

:update(handle)

If the Windows sizes are changed, re-renders the scene to the Window; otherwise only update the Window using internally saved image.

:set{...}

Sets render 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 background color.
size {w, h} Positive numbers in table Sets the image size.