*.o3d Structure

Joined
Apr 3, 2015
Messages
4
Reaction score
0
Hello.

So we all know, how an .obj file is structured, name, v[], vn[],vt[] and f[] arrays, which contain most likely doubles. My question would be, what happens when we convert obj to o3d. I can't really open up an o3d file and view whats inside. It's a quick question, I really would appreciate if you could help :)
 
Hello.

So we all know, how an .obj file is structured, name, v[], vn[],vt[] and f[] arrays, which contain most likely doubles. My question would be, what happens when we convert obj to o3d. I can't really open up an o3d file and view whats inside. It's a quick question, I really would appreciate if you could help :)

Do you know C++? The source handles the o3d file. Here's a quick file structure I wrote up awhile ago in pseudocode. I can't remember if this is the full format or if I didn't finish writing it though. Have fun.

Code:
struct FileName
{
    byte length;
    char path[length];
};


struct Vector
{
    float x;
    float y;
    float z;
};


struct D3DCOLORVALUE
{
    float r;
    float g;
    float b;
    float a;
};


struct NormalVertex
{
    Vector position;
    Vector normal;
    float tu;
    float tv;
};


struct D3DMATERIAL9
{
    D3DCOLORVALUE   Diffuse;        /* Diffuse color RGBA */
    D3DCOLORVALUE   Ambient;        /* Ambient color RGB */
    D3DCOLORVALUE   Specular;       /* Specular 'shininess' */
    D3DCOLORVALUE   Emissive;       /* Emissive color RGB */
    float           Power;          /* Sharpness if specular highlight */
};


struct Material
{
    D3DMATERIAL9 d3dmat;
    uint32 name_len;
    char filename[name_len];
};


struct MATERIAL_BLOCK
{
    int32 m_nStartVertex;
    int32 m_nPrimitiveCount;
    int32 m_nTextureID;
    uint32 m_dwEffect;
    int32 m_nAmount;
    int32 m_nMaxUseBone;
    int32 m_UseBone[28];
};


struct Collision
{
    Vector bb_min;
    Vector bb_max;
    uint32 opacity;
    uint32 bump;
    uint32 rigid;
    byte unknown[28];
    uint32 vertex_num;
    uint32 vb_num;
    uint32 facelist_num;
    uint32 ib_num;
    Vector vertexes[vertex_num];
    NormalVertex vb[vb_num];
    uint16 ib[ib_num];
    uint16 iib[vb_num];
    byte has_physique;
    if (has_physique != 0)
        uint32 physique[vertex_num];
    uint32 has_material;
    uint32 material_num;
    Material materials[material_num];
    uint32 mb_num;
    MATERIAL_BLOCK material_blocks[mb_num];
};


struct Object3d 
{
    FileName path;
    uint32 version;
    uint32 id;
    Vector force1;
    Vector force2;
    if (version >= 22)
    {
        Vector force3;
        Vector force4;
    }
    float unknown1;
    float unknown2;
    byte unknown3[16];
    Vector bb_min;
    Vector bb_max;
    float slerp;
    uint32 frames;
    uint32 event_num;
    Vector event[event_num];
    uint32 has_coll;
    if (has_coll != 0)
        Collision collision;
    uint32 has_lod;
} o3d;
 
Back