My goal is to figure out how to parse MD3 quake model files so that I can write an import/export tool for DeleD. So I found a model here...
http://ioquake3.org/files/models2/q3mdl-imp.zip
And the format definition here...
http://en.wikipedia.org/wiki/MD3_%28file_format%29
I decompressed everything and tried to parse part of the header of the 'head.MD3' file with this python 2 code...
import binascii
import struct
filename = 'head.MD3'
bytes = ''
with open(filename,'rb') as fileptr:
bytes = fileptr.read()
bytes = binascii.hexlify(bytes)
print bytes
print 'IDENT', bytes[0:8].decode("hex"), 'VERSION', bytes[9:17]
Both IDENT and VERSION are supposed to be 32 bits (so says wikipedia). The IDENT comes in good but VERSION is junk...
IDENT IDP3 VERSION f0000000
f0 is 15 which is consistent with the header info but what about the trailing zeroes?
The rest of the hex dump is attached...it does not seem to be consistent with the format defenition. I don't know if I'm not parsing this correctly, if the wikipedia info is wrong or the model is junk. Full output (hex dump of the file) is attached in a txt. Can anyone offer a starting point? Any thoughts?