1.2

| home | graph lib | utility lib | custom lib | auxiliary lib | tutorials |

   Axis
   Blend
   Color
   ColorBar
   Fog
   Freetype
   Light
   Line
   Material
   Node
   Point
   Plot
   Polygon
   Render
   Scene
   Stencil
   TexCoord
   Text
   Texture
   Vertex

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, ...])

object - a zeScene object.

Adds scene objects to the render.

:towindow(handle[, flag])

handle - a Windows handle.
flag - a number.

Renders image to the window. If the flag is none zero, enable OpenGL display list in rendering objects of zePoint, zeLine, and zePolygon.

:tofile(fname[, flag])

fname - file name.
flag - a number.

Renders image to a file. If the flag is none zero, enable 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])

fname - file name.
ms - number of micro second between frames (default = 1000).

Renders image to a AVI movie. 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])

object - a zeTexture object.
alpha - a number between 0 and 255 (default = 0).

Renders the scene the 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)

handle - address of a Windows handle.

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

:set(table)

table - a Lua table.

Sets render properties. Valid key-value paris are listed in the table.

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 output size.