2
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ Where are you exporting it from? \$\endgroup\$ – Quazi Irfan Jul 11 '11 at 15:15
  • \$\begingroup\$ I guess it's somehow easy to develop convertor yourself. since your gameengine can probably both decode and encode X file. \$\endgroup\$ – Ali1S232 Jul 11 '11 at 19:20
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – PatrickB Jul 12 '11 at 0:24
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – PatrickB Jul 12 '11 at 1:00
  • \$\begingroup\$ 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. \$\endgroup\$ – Riley Adams Jul 13 '11 at 3:03
2
\$\begingroup\$

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).

The best option is probably to use a tool like Blender to do file format conversions, or write such a tool yourself. At that point it may be better to select a different file format (as you appear to have), since .X is pretty verbose and long-in-the-tooth these days (as PatrickB noted).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.