J
JWP
Guest
I've been having a few issues extracing the data from the field models. I can find the locations of each section of data, I just think that my interpretation of the data is slightly off.
I've been trying to extract the geometry from the d002.mch file, here are the structures I'm using:
struct vertex {
short x;
short y;
short z;
short unk;
};
struct TextureMap {
BYTE u;
BYTE v;
};
struct face {
u32 opcode; 0x07060125 = triangle, 0907012d = Quad
BYTE unk[8];
u16 verticies[4]; //vertex id's
u16 verticies1[4]; //Edge data???
u32 Vertex_Colours[4];
TextureMap TextureData[4]; //haven't tested yet
u32 Padding[3];
//64 bytes
};
my understanding of the skeleton is such that I've managed to work out how all the bones fit together and the various lengths and I know that all the vertex offsets are relative to the bones that they are linked with. I can tell that most of what I've extracted seems to be alright since I have a (mostly) intact head of squall and body.
EDIT 1: I've fixed the missing polys issue, it was to do with importing the quads wrong and due to this I've also managed to fix the normals issue just by flipping all the
normals.
The issues that I'm having:
FIXED: I've had trouble with the normals, so I've just duplicated all the polygons with the opposite normals for now.
FIXED: There appear to be some polygons missing, like a few triangles of the head and body. (I'll upload a screenshot when I find somewhere to upload it)
The arms and legs appear disjointed and there's a large gap between the body and the arms (I'm guessing this is mostly due to the arrangement of the skeleton and the orientation of the various limbs). I've managed to reduce the deformation somewhat but it's still slightly messed up.
EDIT: I managed to get the textures working now, although I had to manually scale and flip the coords.
Does anyone with a better understanding of the format have a clue what's going wrong?
I've been trying to extract the geometry from the d002.mch file, here are the structures I'm using:
struct vertex {
short x;
short y;
short z;
short unk;
};
struct TextureMap {
BYTE u;
BYTE v;
};
struct face {
u32 opcode; 0x07060125 = triangle, 0907012d = Quad
BYTE unk[8];
u16 verticies[4]; //vertex id's
u16 verticies1[4]; //Edge data???
u32 Vertex_Colours[4];
TextureMap TextureData[4]; //haven't tested yet
u32 Padding[3];
//64 bytes
};
my understanding of the skeleton is such that I've managed to work out how all the bones fit together and the various lengths and I know that all the vertex offsets are relative to the bones that they are linked with. I can tell that most of what I've extracted seems to be alright since I have a (mostly) intact head of squall and body.
EDIT 1: I've fixed the missing polys issue, it was to do with importing the quads wrong and due to this I've also managed to fix the normals issue just by flipping all the
normals.
The issues that I'm having:
FIXED: I've had trouble with the normals, so I've just duplicated all the polygons with the opposite normals for now.
FIXED: There appear to be some polygons missing, like a few triangles of the head and body. (I'll upload a screenshot when I find somewhere to upload it)
The arms and legs appear disjointed and there's a large gap between the body and the arms (I'm guessing this is mostly due to the arrangement of the skeleton and the orientation of the various limbs). I've managed to reduce the deformation somewhat but it's still slightly messed up.
EDIT: I managed to get the textures working now, although I had to manually scale and flip the coords.
Does anyone with a better understanding of the format have a clue what's going wrong?
Last edited: