Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
1  
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. –  The Communist Duck Sep 3 '10 at 19:42
    
Searching for the solution, I've found that the commonly used term is 'encoding'. –  modosansreves Sep 3 '10 at 20:22
    
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. –  modosansreves Sep 3 '10 at 20:24

5 Answers 5

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.

share|improve this answer

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

share|improve this answer
1  
"the suggestion above" doesn't apply to the Stack Exchange system, especially since your answer is now the most upvoted. –  Ricket Sep 10 '10 at 20:00
    
Thanks, yeah, that was kinda dumb of me. Edited. –  Kaj Sep 10 '10 at 20:47

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.

share|improve this answer

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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