Wartbed:Files/Formats/3D

From Dark Omen Wiki

Jump to: navigation, search

All WARTBED file formats related to 3D graphics

Contents

3D Geometry

3D geometry (a "model") is represented as a set of files contained inside a .ZIP archive with .model extension. The archive can contain the following file types and extensions (a model can consist of any number of these types, except for meshes.desc, of which there is always only one).

modelname.model
(.zip archive)
model.desc text (1)
filename.vertices text (2)
filename.indices text (3)
filename.bmp/jpg/png bitmap
filename.skeleton ???
filename.animation ???


Model description

1: meshes.desc
(WARTBED Script)
Mesh_name

{
    vertices : filename.vertices;
    indices : filename.vertices;
    offset : [x,y,z];
}

Mesh_2_name
{
    ...

}


Vertices

Space, tab, '[', ']' and ',' are all valid separators and can be exchanged for reabability. Separators should be able to follow each other (cross your fingers).

The first block is identified by the keyword "definition" (of rather, any character sequence starting with "def") and details the components are their order in a vertex. Valid tokens are "xy" for a two-float dataype, "xyz" for a three-float , "xyzw" for a four-float; and "argb", "bgra" and "rgba" for four-byte colours.

Valid field names are "position", "normal", "diffuse", "specular", "emissive" and "texture coordinate". There can be multiple fields of the same type in a vertex, however, it is not yet defined how WARTBED handles this.

The second block is identified as "vertices" (or "vtx"). Every vertex is numbered (though item identifiers are actually ignored when parsing). Multiple vertex blocks are appended into one consecutive vertex buffer (regardless of vertex numbering).

2: filename.vertices
(WARTBED Script)
definition

{
    xyz : position;
    xyz : normal;
    argb : diffuse;
    argb : specular;
    argb : emissive;
    xy : texture coordinates;
}

vertices
{
    0 : [1,2,3] [0,1,0] 0xFFFFFFFF, 0xF0F0F0F0, 0x10101010 [0,0];
    1 : [4,5,6] [1,0,0] 0xFFFFFFFF, 0xF0F0F0F0, 0x10101010 [1,1];

}


Indices

As for vertices. space, tab, '[', ']' and ',' are all valid separators and can be exchanged for readability, and separators should be able to follow each other.

Each faces block is created in a new index buffer, depending on parsing parameters.

3: filename.indices
(WARTBED Script)

textures
{
    0 : texture1.png;
    1 : texture2.jpg;
}

definition
{
    123 : indices;
    xyz : normal;
    id : texture;
}

faces
{
    0 : 1,2,3 [0,1,0] 0;
    1 : 2,3,5 [0,0,1] 1;
}

faces //requesting creation in new index buffer
{
    ...

}
Personal tools
communication