Jump to content
  • Advertisement
Sign in to follow this  

[directx 9]Mesh

This topic is 3614 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hy. I'm created an importer for collada file. The importer import all the meshes from collada file in a unique big mesh with a subset for any collada mesh. the problem is that with a very large file 10Mb i have a mesh with 100000 vertex and 31000 indexes and this catch an error: D3DX: D3DXCreateMesh: Too many faces/vertices for a 16bit mesh
bool CImporter::CreateMesh(int nVertexes, int nIndexes) { HRESULT hr = D3DXCreateMeshFVF(nIndexes,nVertexes,D3DXMESH_MANAGED,Vertex::FVF,m_Device,&m_mesh); if(FAILED(hr)) { ::MessageBox(0, "Collada CreateMesh() - FAILED", 0, 0); return false; } return true; }
may be Is a wrong method? Is better to create a mesh for mesh in collada file and use a vector for store all the meshes of the file? whath is the best container for meshes in directx? THanks.

Share this post

Link to post
Share on other sites
I have modify the importer for return single more simple divided meshes:

CImporter cin = CImporter(Device,IMPORTER_COLLADA);

for ( int k = 0 ;k <cin.GetAllMeshesCount();k++){

get the mesh in pos k from all the meshes of collada file.
and draw all:


std::vector<ID3DXMesh*>::iterator itMesh;
for(itMesh = m_AllMeshes.begin();itMesh != m_AllMeshes.end();itMesh++)
ID3DXMesh* xmesh= *itMesh;
//for(int i = 0; i < NumSubsets; i++)
// Device->SetMaterial(&mtrl);
// //Device->SetTexture( 0, Textures );
// Mesh->DrawSubset(0);


but the result is no good , not all meshes are drawed!
only some.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!