Little Stick

HomeInfoGalleryDownloadBuyContact


The Little Stick Compact binary format.


When you save a model of a tree you have the option of selecting the "Compact binary" format.

Many 3D file formats are difficult to import into custom programs, or very inefficient with memory. The Little Stick Compact binary format is small and simple. It is designed for the export of Little Stick trees, which can be quite large, into you own applications.

Example C functions to import or export a tree.

Specification

The structure of a Little Stick Compact binary file is as follows:

A 37 byte header.
Contains the ascii characters "// Little stick compact format v1.0.0".

A 1 byte unsigned char.
Contains 1 if the tree has leaves and 0 otherwise.

A 1 byte unsigned char.
Contains 1 if the tree has fruit and 0 otherwise.

For each object, Branches then Leaves (Optional), then Fruit (Optional)
{
A 4 byte unsigned long integer.
Contains the number of vertices and texture co-ordinates used.

A 4 byte unsigned long integer.
Contains the number of indices used.

An array of 4 byte floating point numbers.
Contains all of the vertex data.
The size of this array is 4 * 3 * (Number of vertices) bytes.
Each vertex contains 3 numbers, the x then y then z co-ordinates.
Each number is a 4 byte floating point number.

An array of 4 byte floating point numbers.
Contains all of the texture co-ordinate data.
The size if this array is 4 * 2 * (Number of texture co-ordinates) bytes.
Each texture co-ordinate contains 2 numbers, the x then y co-ordinates.
Each number is a 4 byte floating point number.

An array of 4 byte unsigned long integers.
Contains all of the indices. There are 3 indices for each triangle.
The first 3 indices represent the first triangle.
The next 3 indices represent the second triangle,
and so on until all indices are used.
Only triangles are used. There are no polygons with more vertices than 3.
The size of this array is 4 * (Number of indices) bytes.
There are (Number of indices) / 3 triangles represented.
}



HomeInfoGalleryDownloadBuyContact
 
Little Stick Copyright © 2006 Fenwick Cooper
You can contact Little Stick via email: treebeard@littlestick.com