Game Development Reference
In-Depth Information
The GEO file
The most important file type to be exported is the GEO file, as this is the file
that actually contains all the data to describe our 3D model. In common with all
Marmalade resources, this file is yet another use of the ITX file format.
GEO files are processed by way of a resource handler class called
CIwResHandlerGEO . This class takes care of loading all the data from the GEO file
and submitting it to a singleton class called CIwModelBuilder . This class processes
the model data and generates an optimized version of the data for fast rendering,
which is then serialized to a file.
The CIwModelBuilder class is only available in debug builds, so you can only load
model data in a release build by loading the serialized version of the GROUP file that
references the GEO file.
The exporter will write the GEO files into the model's sub-directory in the same way
as it does with MTL files.
You may have noticed that the GROUP file shown earlier only references
the GEO files, not the MTL files. The GEO resource handler takes care
of loading the MTL files automatically by checking to see if an MTL file
exists with the same base filename as the GEO file.
Let's look at the innards of the GEO file for our cube model.
// Source file: C:/Work/MarmaladeBook/Maya/Cube.mb
CIwModel
{
name "Cube"
CMesh
{
name "Cube"
scale 100.0
CVerts
{
numVerts 8
v {-100,-100,100}
v {100,-100,100}
v {-100,100,100}
v {100,100,100}
v {-100,100,-100}
v {100,100,-100}
v {-100,-100,-100}
 
Search WWH ::




Custom Search