Okay, I spent the last weekend studying the format and here are my notes:
Code: Select all
OFFSET TYPE COMMENT
20 long N
32 + N long # of chunks (model parts) in this file
44 + N long first chunk size in bytes (add 8 bytes to include up to this byte)
60 + N long first chunk vertice count (V)
64 + N long first chunk polygon count (P, seems to be repeated twice)
80 + N float[3] origin (center of mesh ?)
156 + N float[3 * V] vertices
156 + N + 12 * V float[3 * P] normals
156 + N + 12 * (V + P) (struct polygon)[P] byte ??, byte polygon index, byte # of vertices in polygon, byte ??, long ??, in the following bytes one byte out of 4 is the vertex index
I've written a little extractor that follows those specs, and this is what I've come up with so far (APPLE.CHR, CHEESE.CHR and TREASURE.CHR). As you can see, the first two models are fine, but the parts making up the chest are misplaced. It seems to be the case for all models that contain independently animated meshes (the apple and cheese have an animation, but it moves the entire apple, whereas with the chest, only the cover moves. And it is the same for characters (David, Fuge etc)).
Here are the generated .obj making up the parts of TREASURE.CHR:
Box:
Code: Select all
#vertices
v 65.000000 0.000000 40.000137
v -65.000000 0.000000 40.000137
v -65.000000 -0.000015 -40.000122
v 65.000000 -0.000015 -40.000122
v 75.000000 80.000000 50.000061
v -75.000000 80.000000 50.000061
v -75.000000 80.000107 -50.000046
v 75.000000 80.000107 -50.000046
#faces
f 1 4 3 2
f 7 8 5 6
f 8 4 1 5
f 5 1 2 6
f 6 2 3 7
f 7 3 4 8
Cover:
Code: Select all
#vertices
v -75.000000 0.000000 99.999985
v -75.000000 -0.000031 -0.000015
v -75.000000 35.000015 15.000000
v -75.000000 50.000000 49.999954
v -75.000000 35.000000 85.000000
v -75.000000 -0.000000 50.000000
v 75.000000 0.000000 99.999985
v 75.000000 35.000000 85.000000
v 75.000000 -0.000031 -0.000015
v 75.000000 35.000015 15.000000
v 75.000000 50.000000 49.999954
v 75.000000 -0.000000 50.000000
#faces
f 6 2 3 4 5 1
f 8 7 1 5
f 9 10 3 2
f 8 11 10 9 12 7
f 11 8 5 4
f 10 11 4 3
f 2 1 7 9
lock:
Code: Select all
#vertices
v 10.000000 0.000000 -0.000000
v -10.000000 0.000000 -0.000000
v -15.000000 -24.999969 -0.000000
v 7.000000 -39.999969 -0.000000
v 15.000000 -24.999969 -0.000000
v -7.000000 -39.999985 -0.000000
#faces
f 5 4 6 3 2 1
Also I've found three sets of floats after the textures (at the end of the .CHR) which I believe are somehow responsible for positionning the parts because each of them is prefixed with a (part?) index (0-2):
I've tried lots of combinations but I can't get the parts to be placed properly (cover over box, lock next to the box etc)
For the textures, I've confirmed they're included in the CHR file towards the end (there's a big section with bytes corresponding to what I've extracted using the PIX debugger, will work on that asap).
You do not have the required permissions to view the files attached to this post.