

UV FILE FORMATS
===============
LUT files are written in text, and LUB files are written in binary. 

Both file formats support faces with more than 3 vertices.

Both file formats contain UV coordinates for each face vertex listed
in the model.  The order of how the UV coordinates are listed depends
on how the model is stored in the program's memory.  Typically, this is
same order as how it was read from file.  Other than the order, there is
no information to tell what UV coordinate belongs to what face.  Therefore,
these formats are only intended to be used with LithUnwrap, so use them 
with care.


LUT FORMAT
==========
Comments and spaces are ignored.

Num of vertex indices for each face is listed first.
UV coordinates follows as two floats per line.
This repeats for every face.

# comment

4			# num. of vertex indices for this face
0.000000 0.000000	# one UV coordinate (tu,tv) per face vertex
0.000000 1.000000
1.000000 1.000000
1.000000 0.000000

...etc


NOTE: When handling text files, try to maintain the file format as 
close as possible.  Do not use invisible tabs.  Always use CR/LF at 
the end of every line.



LUB FORMAT
==========
A LUB file format starts with a file header, followed by the 
UV data.

typedef float          FLOAT;   // 4 bytes
typedef int            INT;     // 4 bytes
typedef char           CHAR;	// 1 byte


#define LUB_FILE_VERSION  		1
#define LUB_FILE_ID			"LUBH"


typedef struct _LUB_FILE_HEADER {

 CHAR	id[4];          // "LUBH"
 INT	version;        // 1

 INT file_size;		// total file size - sanity check for corrupt files
 INT num_tex_coords;	// total num. of UV coordinates in entire file
 INT num_faces;		// total num. of faces in entire file

} LUB_FILE_HEADER;


typedef struct _LUB_UV {

 FLOAT tu;
 FLOAT tv;

} LUB_UV;


After the file header, this repeats for each face:

INT num_vertex_indices;			// num. of vertex indices for this face
LUB_UV lub_uvs[num_vertex_indices]; 	// one UV coordinate per face vertex


