Game Development Reference
In-Depth Information
but instead of storing frame 20, for example, as the numerical value 20,
the value is stored as 20 * SCENE_TICKSPERFRAME. If SCENE_
TICKSPERFRAME is 160 then the stored value for frame 20 will be
20
×
160 = 3200
The tag SCENE_BACKGROUND_STATIC stores the background colour
in RGB format. Each value is stored as a floating-point value with the
maximum value of a colour component being represented by 1.0 and the
minimum value being represented by 0.0. The tag SCENE_AMBIENT_
STATIC stores the global ambient lighting level as an RGB value stored in
the same way as the background colour tag. Both the background colour
and the ambient level can change over time; if this is the case then the
tags SCENE_BACKGROUND_ANIM and SCENE_AMBIENT_ANIM will
be present. We will look at parsing an animation section later in this
chapter.
*SCENE {
*SCENE_FILENAME "Box.max"
*SCENE_FIRSTFRAME 0
*SCENE_LASTFRAME 100
*SCENE_FRAMESPEED 30
*SCENE_TICKSPERFRAME 160
*SCENE_BACKGROUND_STATIC 0.0000 0.0000 0.0000
*SCENE_AMBIENT_STATIC 0.0431 0.0431 0.0431
}
The MATERIAL_LIST section
As is so often the case with CGI data structures, the materials section is
the most complex to parse. It contains many subsections that need to be
individually handled. When parsing a MATERIAL_LIST section I did a lot
of guessing; if any reader is aware of errors then please contact me by
mailing nik@toon3d.com. An update will be available for readers at
toon3d.com/book; this will contain updated source code as it becomes
available and will address any errors that are pointed out.
When parsing the material list, the first tag is MATERIAL_COUNT. This
gives a numerical value of the total number of materials in the list. At the
root of the MATERIAL_LIST section the only other tag is MATERIAL,
followed by an integer giving the material number. The MATERIAL section
is a subsection of MATERIAL_LIST. A MATERIAL subsection uses a large
Search Nedrilad ::




Custom Search