Re: Marvel Ultimate Alliance 2 .DAT
Posted: Tue Aug 02, 2016 2:12 am
nice to see you getting the hang of it!
the face has holes because it is only 1 of 4 submeshes
search for 00 00 01 00 02 00 to jump to the face indices start address of each submesh
sequence assumes there is no room for other data within the vertex stride
therefore the other data like normals and UVs etc must be in their own block
Hex2obj doesn't deal with normals so we don't worry about that.
a float is 4 bytes, if XYZ position are stored in floats then that is 12 bytes
if the vertex stride is 12 bytes, there is no room left for other data
and must be elsewhere in the file.
i go by this rule
if FVF is 12 and stored as Floats you can use sequence
if FVF is 6 and stored as ShortAll you can use sequence
if FVF is 6 and stored as HF_all (half-float) you can use sequence
i can't recoginze half-floats and shorts by looking at the numbers, but i do know what 2 bytes looks like
there is a table with offsets and lengths in the 00000000.dat file starting at 0x9a0
little-endian byte order
0x9a0 - 3 bytes - length of vertex block for 1st submesh
0x9a8 - 3 bytes - start address of vertex block for 1st submesh
0x9b0 - 3 bytes - length of face indices for 1st submesh (divide by 2 to get num faces)
0x9b8 - 3 bytes - start address of face indices for 1st submesh
0x9c0 - 3 bytes - length of vertex block for 2nd submesh
etc
those lengths and addresses (except face indices lengths) actually end with either 10 or 02
10 represents a length
02 represents an address
the face has holes because it is only 1 of 4 submeshes
search for 00 00 01 00 02 00 to jump to the face indices start address of each submesh
sequence assumes there is no room for other data within the vertex stride
therefore the other data like normals and UVs etc must be in their own block
Hex2obj doesn't deal with normals so we don't worry about that.
a float is 4 bytes, if XYZ position are stored in floats then that is 12 bytes
if the vertex stride is 12 bytes, there is no room left for other data
and must be elsewhere in the file.
i go by this rule
if FVF is 12 and stored as Floats you can use sequence
if FVF is 6 and stored as ShortAll you can use sequence
if FVF is 6 and stored as HF_all (half-float) you can use sequence
i can't recoginze half-floats and shorts by looking at the numbers, but i do know what 2 bytes looks like
there is a table with offsets and lengths in the 00000000.dat file starting at 0x9a0
little-endian byte order
0x9a0 - 3 bytes - length of vertex block for 1st submesh
0x9a8 - 3 bytes - start address of vertex block for 1st submesh
0x9b0 - 3 bytes - length of face indices for 1st submesh (divide by 2 to get num faces)
0x9b8 - 3 bytes - start address of face indices for 1st submesh
0x9c0 - 3 bytes - length of vertex block for 2nd submesh
etc
those lengths and addresses (except face indices lengths) actually end with either 10 or 02
10 represents a length
02 represents an address