# How can I convert .X files from text to binary form?

Is there a tool for Linux (preferably a command-line tool) that can convert from the .x text format to the binary format? I wish to use this format with Irrlicht but the text format is loading very slowly (taking around 8 seconds to load one model), so I'm wondering if the binary format will be faster.

I have seen this question, but that seems to be asking more for pointers on learning the .x format, whereas I am specifically looking for a Linux tool.

• Where are you exporting it from? – Quazi Irfan Jul 11 '11 at 15:15
• I guess it's somehow easy to develop convertor yourself. since your gameengine can probably both decode and encode X file. – Ali1S232 Jul 11 '11 at 19:20
• 8 seconds!?! That's an eternity in CPU time. Are you sure you aren't getting the time it takes to read the file from disk, make coffee, load textures, create mipmaps, and THEN parse it? I wrote a text *.x file loader and a P2@333MHz could do it in a fraction of a second. – PatrickB Jul 12 '11 at 0:24
• That is to say, I don't think text vs binary is the problem. I'd check out that problem first before you invest too much effort into solving the text->binary problem. If you do want use a binary format, *.x probably is a very poor choice since it is essentially the same as *.x text but using tokens instead of single characters, e.g. comma gets a 32-bit token, semicolon gets a 32-bit token, etc. – PatrickB Jul 12 '11 at 1:00
• I haven't used irrlicht in years, but I remember its .x loading gave me endless problems; if there's any other format you can use, you might be best off looking into that. – Riley Adams Jul 13 '11 at 3:03

As far as I'm aware, there is no such tool -- at least not one dedicated to this task that would run on Linux (or, for that matter, Windows -- the closest you might is meshconvert.exe which was part of the SDK, but even if it would run via wine it probably won't do what you need it to).