Reputation: 21
I know that using DXUT you can import a .x model using the CDXUTSDKMesh::Create() method:
g_Mesh.Create( pd3dDevice, L"tiny.x", (D3D10_INPUT_ELEMENT_DESC*)layout, 3 );
Without using DXUT, is there a simple way to import a .x model?
I haven't found much about this on the net, and I'm wondering if someone could point me in the right direction.
Or, if there is no easy way to import an x. model in DX10, what model format do you recommend and how would you go about loading it into a ID3DX10Mesh?
Upvotes: 2
Views: 1510
Reputation: 4251
If you don't want to use DXUT, you have to create your own importer (which can be hard) or use Assimp.
However my advice is to use Assimp. Assimp helps you load models in various formats but you have to know how to use Assimp to get the vertices/indices arrays and use them in the D3DX10CreateMesh() function. Also take a look at Assimp documentation and samples. When you get Assimp working it will allow you to load every format it supports with any modification in your code.
Upvotes: 3