Graphics

[ LiB ]

Graphics

Lua is no slouch when it comes to graphic application integration. Lua owns a handful of open engines and even one that has been used in several commercial games . Although it is uncommon to find a completely Lua-based graphic engine, it's extremely common to find engines that rely on Lua to perform the underlying scripting.

Apocalyx 3D Engine

Apocalyx is an OpenGL 3D engine that includes Lua scripting support. The engine comes with a built-in console that can be launched and will fire Lua scripts or execute lines of Lua. The following commands are viable on the command-line console:

h. Reads the complete list of commands.

l. Reads a list of the scripts.

r. Executes a script.

c. Compiles a script.

i. For entering Lua lines.

Apocalyx has an entire API with exposed features and classes for Lua to manipulate. These classes are highlighted in Table 8.18, but for complete reference, check out the online manuals at the Sourceforge project page, at http://apocalyx.sf.net.

Table 8.18. The Apocalyx API

Class

Purpose

Child classes

Background

Used to render the sky and out of reach background objects

HalfSky

Image

Converts images and checks for alpha

Texture

Material

Holds the light properties of a surface

BumpedMaterial

Reference

Changes position and orientation of objects in 3D space

Transform (parent class), Camera , Object

Sample

Creates sounds

Sample3D , Sound , Music

Simulator

Holds physics data

ParticleSet

Socket

Holds methods for networking

Host

Terrain

Renders the ground

Scenery

Win

Manages application window

Scene , World , Filesystem

Zip

Holds methods that retrieve data from zip files


Doris

Doris is an OpenGL viewer driven by Lua. It uses Lua, bound to OpenGL, GLUI, and GLUT, for creating graphics scripts. Doris was mainly built to perform graphical experiments, but it is also great sample code for learning how to code with Lua, OpenGL, and 3D.

Doris can be found on the Doris Sourceforge page, at http://doris.sourceforge.net. Doris was created by Nick Trout and named after his pet hamster. Currently there are versions of Doris for both Lua 4 and Lua 5. The Sourceforge page includes Lua code samples.

Nebula

Nebula is an open-source, 3D, real-time game engine written in C++. Nebula is actually scriptable through a number of languages, including both Python and Lua. It supports Direct X (8.0 and 8.1) and OpenGL and currently runs on Linux and Windows worlds .

Nebula is a base technology engine released by Radon Labs in Berlin, at http://www.radonlabs.de. Radon is responsible for a few large game products, including Project Nomads , released by CDV in 2002, and Urban Assault , released by Microsoft in 1998.

Radon is currently at work on the second generation of Nebula, Nebula2, available as a Sourceforge project. This new version of Nebula will include a new graphic system and subsystems and improvements to the code used for programming on the X-Box and will also incorporate changes made to the Nebula engine from the recent publishing of a few Radon games. Radon also plans to port Nebula to OpenGL and Linux and do a rewrite of Lua and Python support for the new engine. For more information on Nebula, check out the Nebula Wiki, at http://nebuladevice.sourceforge.net/cgi-bin/twiki/view/Nebula/.

[ LiB ]


Game Programming with Pyton, Lua and Ruby
Game Programming with Pyton, Lua and Ruby
ISBN: N/A
EAN: N/A
Year: 2005
Pages: 133

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net