4
\$\begingroup\$

As far as I know, .X format can be text encoded and binary-encoded.

I basically want to look into the model I'm playing with, get a better understanding of .X, possibly make some changes in it and convert back.

\$\endgroup\$
  • 1
    \$\begingroup\$ What do you mean by 'transfer to text'? All you would get is a list of model vertices, and then potentially animation data, etc. If you want to change it, why not use a modelling program? And you won't get more experience than by writing a loader. \$\endgroup\$ – The Communist Duck Sep 3 '10 at 19:42
  • \$\begingroup\$ Searching for the solution, I've found that the commonly used term is 'encoding'. \$\endgroup\$ – bohdan_trotsenko Sep 3 '10 at 20:22
  • \$\begingroup\$ I have to convert all the data to text encoding, which is understandable and try to make some changes with F#. This is a straight-forward solution. Thanks. \$\endgroup\$ – bohdan_trotsenko Sep 3 '10 at 20:24
3
\$\begingroup\$

Well, apart from other's suggestion to use a modeling package that can read/write both formats (polytrans can do it but ain't free), your original post links to both formats so if all else fails you got everything needed to be able to read and write both formats....

\$\endgroup\$
  • 1
    \$\begingroup\$ "the suggestion above" doesn't apply to the Stack Exchange system, especially since your answer is now the most upvoted. \$\endgroup\$ – Ricket Sep 10 '10 at 20:00
3
\$\begingroup\$

There is a mesh convert tool in my directory of DXSDK. I can convert .x format from binary to text and text to binary (among other things).

C:\Program Files\DXSDK\Utilities\bin\x86>MeshConvert.exe

\$\endgroup\$
2
\$\begingroup\$

When the model was exported from the 3d modeling app, whoever exported it chose binary instead of ascii.

One way to convert it would be to import the model into any 3d modeling app that supports .x (there are free ones out there) & re-export in ascii format.

\$\endgroup\$
2
\$\begingroup\$

If it's so straight forward, why can't you solve it? No need to be rude.

Anyway, the first hit on Google is the spec that tells you exactly how you can perform the conversion: http://msdn.microsoft.com/en-us/library/bb173014%28VS.85%29.aspx

Alternatively, a Google for tools that will do this brings up plenty of hits.

Straight-forward indeed.

\$\endgroup\$
2
\$\begingroup\$

If your goal is to get a better understanding of the X file format, it might be worthwhile to write a converter yourself. All of the information you would need to do this is on the MSDN link that Rushyo provided: http://msdn.microsoft.com/en-us/library/bb173014%28VS.85%29.aspx.

\$\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.