The Example Project
This project is designed to test the Blender export facilities and the stand-alone
file conversion utilities needed to move 3D objects from Blender, where you
build them, to the Auran Jet game engine, where you use them.
Last updated: 12/01/2001
The Initial Objective
The project is intentionally simple so we can check any part of it by hand
without getting lost in a vast sea of 3D data. It consists of just two cubes.
One is covered with a grid texture projected using the Blender's Cube option.
The other is split into two separate pieces: a single flat face supporting a
plain concrete texture, and the remaining five sides using a simple green material
and no texture. Here's the original objects displayed in Blender with direct
and fill lighting.
Out first objective is to create one Jet object displaying the grid pattern
on the "face" of the grid cube, and another Jet object displaying
the green material and concrete pattern on the small cube. Don't worry about
the rest of the faces on the large cube yet, Jet requires that we break it into
separate faces to texture each face individually, but that is easy to do.
The object of this initial exercise is to create an ExportGridCube.im Jet Indexed
Mesh file for the grid cube, and an ExportSmallCube.im Jet Indexed Mesh file
for the small cube.
The final result, running in a simple Jet application, looks like this (note
that this picture uses undirected ambient lighting and a somewhat different
camera angle, so shadows, highlights and the background are all a bit different):
The conversion routines project the grid texture directly through the large
cube. If viewed from the back, you would see a reversed image of the front texture,
just as you would in Blender. The top, bottom, and sides are pixels extruded
back through the cube, and may change as the angle of view to the object changes.
The process used to move these objects from Blender to the Jet engine include
the following steps:
- Create or find the textures you will need. I created
128BitGrid.tga using the GIMP image manipulation program, and I
on a free list on the Internet. I used Targa (*.tga) files because
they support alpha data (when needed), and look good when resized. Note: Jet
does not support compressed *.tga files, so you will not be able to use this
feature. Make sure that each dimension is a power of 2, or Jet will be unable
to load them into Open GL components.
- Build the 3D objects in Blender,
TestCube.blend in this case.
- Use the GenericExport.py
Python script from within Blender to export the structure
of the 3D objects to the
BlenderExport.txt export file (see Export
Script for details).
- Manually create the
BlenderExportSplitCtrl.txt file to control which 3D objects
go into each individual resource file. In this case, the large cube object
goes into one file while the face object (which gets the concrete texture)
and the rest of the small cube that was split away from the face go into another
is a very simple file, and should not change unless you add new
objects or change the structure of existing objects.
- Run the export file splitter to create
the two object-specific export files:
ExportSmallCube.txt. If you only have a single objet in your Blender
file, you can skip these two steps.
- Manually create the
BlenderExportTextures.txt file to describe the two textures used,
and to link them to their parent surfaces. This step will be obsolete once
Blender can export texture information directly through its Python interface.
In the meantime, the file should not change much unless you change your texture
names or properties a lot
- Run the export file converter against
each of the object-specific export files and the texture file to create two
Jet Indexed Mesh files:
- Create a Jet application to load and display these resource files. I modified
the original IndexedMesh example which simply orbits the camera around the
loaded meshes (which automatically go directly into the same locations they
had in the Blender environment) using simple ambient light.
Despite the simplicity of this example, I have used this process to export
fairly complex objects. The monorail I'm playing with has about 7500 polygons
in 45 separate components made up from 15 different 3D Blender objects. There
are also about 15 different pieces in the initial track objects which use, in
some cases, over a thousand additional polygons for each track section. The
process to export, split, and convert all of this is surprisingly fast and easy.
When we fix the workarounds, it will be even easier. To see the models mentioned
here, click here to see the real project.
Next steps include the following
- Get tiled textures working in Jet.
- Get bump maps and multiple-texture configurations working in Jet.
- Work with the Blender community to export Blender texture information through
the Python interface.
- Look at exporting bones, influences, and other aspects of articulated models.
- Look for an algorithm to create varying levels of detail (LOD) from standard