   [DirectX10/Assimp] Index buffer trouble
  I've tried to build in Assimp into my engine, but I have some trouble with the index buffer. DirectX means that the values in the Index buffer are invalid:D3DX10: ID3DX10Mesh: Fatal error: index buffer contains invalid entriesAnd after looking at the Assimp viewer I just got more questions. Here is what I try to do://-------------Indices--------------DWORD* Indices = new DWORD[MeshScene->mMeshes[NumMesh]->mNumFaces*3]; //A Vertex has 3 points, so *3UINT Face=0;for(UINT i=0;i<MeshScene->mMeshes[NumMesh]->mNumFaces;i++){//Fill our index bufferint ii=0;for(ii=0;ii<MeshScene->mMeshes[NumMesh]->mFaces[Face].mNumIndices;ii++){Indices=MeshScene->mMeshes[NumMesh]->mFaces[Face].mIndices[ii];i++;}Face++;}*oIndices=Indices; //Finished filling the index buffer, set the output*IndicesSize=MeshScene->mMeshes[NumMesh]->mNumFaces*sizeof(DWORD)*3; //Set index buffer size in bytesI used another loader before, and I set the Indices just the way I did it here. Here is a part of my old loading function, but the parameters are still the same:Mesh->GetIndexBuffer(&mb);void* MeshIndexData;DWORD* IndexData=new DWORD[mb->GetSize()/sizeof(DWORD)];mb->Map(&MeshIndexData,&size);    memcpy(IndexData,MeshIndexData,mb->GetSize());mb->Unmap();*IndicesSize=mb->GetSize();*oIndices=IndexData;mb->Release();In the code of the Assimp viewer I have seen this:g_piDevice->CreateIndexBuffer( 2 * mesh->mNumFaces * nidx, ...while nidx is the face-style (Point=1,Line=2,Triangle=3), so for most meshes it is 3. But why the *2? Please help me! :(Edit: I found some logical errors in the code above and updated it. But it still isn't working as it should! (Same error)[Edited by - mind in a box on May 5, 2010 11:40:02 AM]
  Ok, I've solved the problem with the index buffer. Next problem: How to set up the Attribute buffer?? I have just no idea :(   