MDL

#7
Thanks, that cube .mdo file will help a lot when I go there (if no one beats me to it)

If you can afford to prepare slightly dissimilar models and compare the outputs that can be a very effective way to figure out what's what. I'm completely useless when it comes to using the From' import tools. Not that it matters with .mdl (because there are none that I know of)

My approach ultimately was just to stare at a few different files in a hexeditor like a WW2 codebreaker, occasionally testing series by making changes and loading the MDL into Objedit to see what happened. That weird BOX1.MDL file I found really helped get the ball rolling but I mostly relied on the arrow, arm, fire/fake, and the wooden chest (O000.MDL)

I have to admit I'm a little curious where BOX1.MDL came from.

[code=The MDL header looks like this]struct Header_SOM
{
//! 16 bytes
uint8_t unknown00; //! perhaps bitwise flags
uint8_t num_anims; //! reference frame animation
uint8_t num_stops; //! stop-motion like animation
uint8_t num_skins; //! texture images
uint8_t num_parts; //! one or more required
uint8_t unknown03; //! perhaps always one
int32_t off_anims; //! dword anim/stop/skin block offset
int16_t unknown04; //! perhaps always zero
int16_t add_anims; //! dword sizeof anims block
int16_t add_stops; //! dword sizeof stops block

//! this is the actual order of the data blocks in the file
int32_t offset(int fourcc, int pt=0)const
{
switch(fourcc)
{ ‎ 
case 'base': return 4+7*num_parts;

case 'face': return 4+AI_BE(parts[pt].off_faces);
case 'vert': return 4+AI_BE(parts[pt].off_verts);
case 'norm': return 4+AI_BE(parts[pt].off_norms);

case 'anim': return 4+AI_BE(off_anims);
case 'stop': return 4+AI_BE(off_anims)
‎  ‎  +AI_BE(add_anims);
case 'skin': return 4+AI_BE(off_anims)
‎  ‎  +AI_BE(add_anims)
+AI_BE(add_stops);

default: return 0x7FFFFFFF;
}
}

struct //! 28 bytes (these may actually be 16bit)
{
int32_t off_verts; //! dword offset to vertex block
int32_t num_verts; //!
int32_t off_norms; //! dword offset to normal block
int32_t num_norms; //!
int32_t off_faces; //! dword offset to face block
int32_t num_faces; //!
int32_t reserve00; //! probably always zero
}parts[1] PACK_STRUCT;

} PACK_STRUCT;[/code]
Reply



Messages In This Thread
MDL - by HolyDiver - 2010-04-02, 04:35 PM
Re: MDL - by HolyDiver - 2010-04-02, 07:17 PM
Re: MDL - by HolyDiver - 2010-04-05, 04:05 AM
Re: MDL - by Madison Lastrega - 2010-04-06, 06:28 AM
Re: MDL - by Madison Lastrega - 2010-04-06, 07:19 AM
Re: MDL - by HolyDiver - 2010-04-06, 06:56 PM
Re: MDL - by HolyDiver - 2010-04-06, 11:27 PM
Re: MDL - by Madison Lastrega - 2010-04-07, 05:17 PM
Re: MDL - by HolyDiver - 2010-04-07, 06:23 PM
Re: MDL - by HolyDiver - 2010-04-08, 03:18 AM
Re: MDL - by HolyDiver - 2010-04-08, 10:19 PM
Re: MDL - by Madison Lastrega - 2010-04-10, 05:15 AM
Re: MDL - by HolyDiver - 2010-04-10, 05:55 AM
Re: MDL - by Madison Lastrega - 2010-04-10, 07:22 PM
Re: MDL - by HolyDiver - 2010-04-10, 09:22 PM
Re: MDL - by HolyDiver - 2010-04-10, 09:24 PM
Re: MDL - by HolyDiver - 2010-04-20, 10:48 AM
Re: MDL - by HolyDiver - 2010-04-21, 01:45 PM
Re: MDL - by HolyDiver - 2010-05-03, 01:06 AM
Re: MDL - by HolyDiver - 2010-05-03, 07:59 PM
Re: MDL - by HolyDiver - 2010-05-04, 12:16 AM
Re: MDL - by HolyDiver - 2010-05-07, 07:27 AM
Re: MDL - by HolyDiver - 2010-05-10, 11:29 AM



Users browsing this thread:
10 Guest(s)