Reading aircraft MDL files

This must have been one of the most often requested features for ModelConverterX. And I should directly say that it is not implemented completely yet, but this weekend I started on adding the functionality to read aircraft MDL files from FS2002 and FS2004. Below you can see a screenshot of the default fueltruck MDL that comes with FSX. But in fact it is in the FS2004 aircraft MDL format.

So as you can see this relatively simple object can be imported now, but I should be honest and say that most of the other models I try still fail. This usually happens because some BGL opcode is encountered that ModelConverterX is not aware of yet. So I think some more and better testing is needed before I can put this functionality in the development release.

While working on this feature, I also came across two BGL opcodes that seem to be unknown to the BGLC_9 compiler. These are C9 and CC. Their functionality seems very similar to the VertexList and DrawTriList commands, although some of the parameters are 32 bit, instead of 16 bit long. I do not fully understand yet what the differences are, but hopefully this will also start to make sense soon.

2 thoughts on “Reading aircraft MDL files

  1. Christian says:

    In rgds to the opcodes. If I remember correctly there are two data blocks that in fact are no opcodes but rotation matrices. If you export the sample FS2002 aircraft, you’ll find that there are blocks of matrix data. That’s what those blocks are. It’s pretty easy if you actually have the source BGl code to compare.

    Hope that makes sense. If you need more info I’ll go dig out my code (which a few years old).

    Looking forward to the aircraft support…

  2. arno says:

    Thanks I will take a look at that. Using them as vertex and triangle list worked quite good. So they seem to be more than matrices.

    Arno

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.