2

I have a requirement in which I have to save my 3D mesh figure in .x format. I am making my figures using WPF with C# (as DirectX support not present in Visual Studio 2010 - C#).

After making 3D figures (sphere, cone etc), I have to store the vertex, normals etc in .x file. Can't use any other format as the need is to keep it supported with DirectX.

I am not able to find a parser which can allow me to read and write in .x file (in C#) without using DirectX APIs. I only found one in C++ here: http://www.xbdev.net/3dformats/x/x_binary/index.php. But this is regular read/write parsing and I was looking for some library or APIs.

Can someone please help on this?

Aman
  • 696
  • 1
  • 8
  • 26
  • +1 Because i had the same problem years ago and gave up. – Felix K. Nov 20 '12 at 10:12
  • Assimp any use to you? even if it doesn't export to X files directly it's open source and might give you the tools you need. http://assimp.sourceforge.net/lib_html/index.html – Andy Nov 20 '12 at 10:13

1 Answers1

2

You've got the X model spec described on MSDN here:

Another point of view from Paul Bourke:

And you could look at MonoGame:

Not sure how far along they have got in actually fully implementing support for the different DirectX asset formats, but there's a stack of code you could look at in MonoGame.Framework.Content.Pipeline\Graphics and MonoGame.Framework\Graphics for inspiration.

Colin Smith
  • 12,375
  • 4
  • 39
  • 47