Game Development Reference
In-Depth Information
Lightwave 6+; for full documentation on LWO2 sub-chunks, see the
details at the end of this topic.
COLR
LWO1 files store colours as 1-byte integers for red, green and
blue.
VDIF
A floating-point value that stores the diffuse level.
VLUM
A floating-point value that stores the luminous level.
VSPC
A floating-point value that stores the specular level.
VTRN
A floating-point value that stores the transparency level.
CTEX
A colour texture we read whether the mapping is planar,
cylindrical or spherical.
TIMG
If we encountered a texture then we can read the filename for the
bitmap.
TWRP
A flag indicating whether a texture tiles.
TSIZ
The overall size of a texture used by planar and cylindrical
mapping.
TCTR
The centre of the texture.
TFP0
Used to store special data about a texture, we use it simply for
the width repeat total.
TFP1
Used to store special data about a texture, we use it simply for
the height repeat total.
Using these sub-chunks we can create a fully textured object.
Lightwave until version 6 did not store any texture coordinates in an object
or scene file. Anyone parsing a pre 6 file has to generate the texture
coordinates themselves. The more detailed surface loader is as follows:
BOOL CLWObject::LoadSurface(FILE* fp, int length)
{
char buf[5], nm[128];
int r, count, index;
unsigned short s;
SURFACE *srf = &srfs[index];
float flt;
if (index>=numsurfaces) return FALSE; //Index out of range
//Read name
ReadString(fp, nm, count, 127);
index=0;
//Try to find the name
Search Nedrilad ::




Custom Search