Just didn't know why when I try to retrieve the attribute table from the m_pOrigMesh after it gets loaded, it reports zero attributes, only after I setup the subsets, that is the attribute table manually. I would like to first assign the original materials to the attribute table or buffer an initial value, and when I want to change certain parts, I alter the table. But since I don't have this information handy, that is which face is mapping to which material slot, when I make up a certain material for a certain subset, I need to make up the rest of the material mapping, which the original intentions were no change.
Any ideas?
Thanks
Jack
if (FAILED(D3DXLoadMeshFromXA(pFilename, D3DXMESH_MANAGED, d3d::GetInstance().GetDevice(),
NULL, &l_buff, NULL, &numMats, &m_pOrigMesh)))
{
cout << "Failed to load mesh: " << pFilename << endl;
throw(cError);
}
}
else
{
cout << "Failed to load mesh: " << pFilename << endl;
throw(cError);
}
D3DXMATERIAL* _mats = (D3DXMATERIAL*)l_buff->GetBufferPointer();
DWORD numFaces = m_pOrigMesh->GetNumFaces();
↧