Ok, changed that
Now we need to figure out what FourCCs we need. We should use a standard naming convention... all lower case would be simplest. Also, when listing them, replace spaces with dashes ('-') but don't use that in the files themselves.
First we'll need textures. I propose that we have a FourCC called 'tex-' which stores the properties and filenames of a given texture. My current thought is that we simply have an unsigned long indicating the texture ID, then properties/filenames in the format 'string name, string value' for however many entries there are. This will keep some degree of simplicity.
Now the other three main things are vertices, polygons, and octree data.
Vertices, I think, should be stored in an atom with the FourCC 'vert'. The format should simply be an unsigned long indicating its vertex group id, then an unsigned long indicating the number of vertices, then an array of the following structs:
Code:
struct Vertex {
double x, y, z; // Position
double i, j, k; // Normal
double u, v; // Texture coords
};
The vertex group ID allows multiple 'vert' atoms in the same file to be addressed seperately.
Polygons should be in an atom with the FourCC 'poly'. To allow for addressing of vertex groups, the 'poly' atom should start with an unsigned long indicating the vertex group it will be dealing with, then an unsigned long indicating the number of polygons, followed by an array of the following structs:
Code:
struct Poly {
unsigned long v1, v2, v3; // Vertex indices in the indicated vertex group
unsigned long tex; // Texture id.
unsigned long flags; // If bit 1 is set, it can be walked through, if bit 2 is set, it is transparent.
};
Any input?
Edit #1: Added flags field to Poly
Edit #2: Added i, j, and k fields to vertices.
Edit #3: Switched the order of texcoords and normals.