Game Development Reference
Figure 18.2 Close-up of Jpeg file and source.
considering compression strategies. The table-based methods used by
LZW (Zip and gif) compression do not lend themselves to 3D, since it
would be useful if we could display content as it streams rather than wait
for the entire file to download before decompression takes place. We will
concentrate on looking at ways that we can compress and decompress as
each bit of information is set and received.
Compressing a mesh
To define a mesh we need a point list, a polygon list and a surface list. We
do not need to pass normal information since the program that we are
going to use to display the content can easily generate this. We will look
at techniques to compress each list in turn.
The vertex list contains an array of vector values, each vertex having an
x , y and z value. If we define a vertex using double values then each
vertex will take 24 bytes. If we use float values then each vertex will use
12 bytes. A considerable improvement, but can we do better? Since real-
time applications are relatively low polygon, we could choose to store a