Jump to content

Research: Mesh files (*.msh)


pivke
 Share

Recommended Posts

Hi all,

 

I finally managed to crack up all sections of the mesh file format (*.msh). Till now we were only able to read the static mesh data from a model file. 2 sections with the description "GTOM" and "MATL" did some serious headache to people like me and legomoe (as he tried to reverse engeneer them too). I was pretty sure all the time, that those section meant the following:

"GTOM" - "Geometric transformation" and "MATL" - "Materiallist". But my assumption was wrong.

 

After heavy reverse engeneering and many trial'n'error on those files, I finally got it. Those sections are adding custom matrix-transformations to specific objects of the mesh file. For example: When you are watching the policecar_lod1.msh (file being used to generate police car ingame) in LI2GE, you will notice that several objects like wheels and stuff are not on the right place. They are basically located in the origin of the model. The same for helicopter or buildings which have animated objects (like the door on radio station).

 

Here is how those sections work:
 

GTOM - "Geometrical transformation"
{
	DWORD NumberOfObjects; //Representing the objects of the mesh, has to be the same amount like in GRPL
	DWORD Index[ NumberOfObjects ]; //Index to the matrixlist
}

MATL - "Matrixlist"
{
	DWORD NumberOfMatrices;
	
	struct Matrix[ NumberOfMatrices ]
	{
		FLOAT TranslationXAxis;
		FLOAT TranslationYAxis;
		FLOAT TranslationZAxis;
		
		FLOAT RotationXAxis;
		FLOAT RotationYAxis;
		FLOAT RotationZAxis;
		
		FLOAT ScaleXAxis;
		FLOAT ScaleYAxis;
		FLOAT ScaleZAxis;
	}
}

This was pretty hard to find out.

 

To make this information useful, we now can apply those matrix-manipulations on the corresponding object in the mesh. Everything will get on the right place then. We are basically able now, to insert our custom models (even like new high poly cars etc.). To make life easier I'm thinking of programming a 3D-Editor to apply those custom objects to your mesh.

 

But that's not all; I'm sure that those matrix-manipulations are there to let Lego Island 2 know, which objects are going to be animated. Next step would be to crack up mesh-animationsfiles to create custom animations.

Link to comment
Share on other sites

"MatAnim" folders and the corresponding "man"-files make sense now too. Here is probably the matrix-animation information stored. Don't know if angle- or keyframe-animated for now.

Link to comment
Share on other sites

17 minutes ago, Hexadecimal Mantis said:

Nice work

Thanks buddy!

 

Noticed something; The geometrical transformation has probably nothing to do with basic animations, because model objects are recalculated by *.man-files. So they are keeping their own matrix-information. You can reproduce this by changing (scaling) for example the police car tire. In static mode it will appear just as you modified it, but when you enter the police car and drive with it, the car looks like original. So this means the animation files keep their own matrix-information.

 

Next step should be to look out for the matrixlist inside animation files.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.