
| 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 |
How to install zeGraph for LuaUnzipping the downloaded file to a directory is all the required procedure to install zeGraph. The software does not have a graphic user interface yet. Fancy installation procedures are not necessary. Many programmer prefer this kind of installation because they know the software will not mess up the system registration or copy files to the system directory without their knowledge. How to write program and execute itzeGraph uses Lua as the scripting language and OpenGL as the rendering engine; therefore you need to have the basic knowledge of OpenGL and know how to program in Lua. The online manual of Lua and the OpenGL red book have sufficient information need to use zeGraph. Going through the notes on zeGraph may help you to know how much knowledge of Lua and OpenGL is necessary for using zeGraph.
Any text editor can be used to write Lua code that calls zeGraph functions. The code can be execute from a DOS command window. A good text editor usually has the capability to issue DOS command and catch the output. SciTe is one of the best free text editors, especially for editing Lua code because it has syntax highlighting feature for the language. If the Lua code creates a window, execute the code from SciTe may show nothing because SciTe waits for the return from the window which will not return unless the user close it. SciTe document indicates that you can change this behavior. Another excelent free editor is the Crimson Editor. How to register zeGraph libraries and create objectsBecause of the way Lua loads dynamically linked library and zeGraph's royalty to Lua's design, a new zeGraph object should be create following these steps:
zeGrf = loadlib("zeGraphL.dll", "zeGraphRegister")
zeGrf = zeGrf() -- Register zeGraph functions
render = zeGrf.new("render") -- Create a render
The loadlib() function in the first line tries to find the function named zeGraphRegister in zeGraphL.dll; and the second line resisters the meta table of zeGraph to the global table of Lua. We prepared register.lua to simplify these steps. Using require("register") as the first statement, you will get zeGrf, zeUtl, and zeAux as handles for calling functions in zeGraphl.dll, zeUtilityL.dll, and zeAuxiliaryL.dll Because the first argument of an object's function is usually the objects itself, its functions should be called as object:func() so that you can omit the first argument (i.e., object). Functions not belonging to any object must be called, for example, as zeMath.cos(a) The calling convention for each function is explicitly written. |