How can i get the textures of an 3DSFile ?
In the Scene is no problem:
Code: Select all
irr::scene::ISceneNode* n = device->getSceneManager()->getSceneNodeFromId( m_iRootMeshID );
int count = n->getMaterialCount();
for ( int i = 0; i < count; ++i )
{
const irr::video::SMaterial &mat = n->getMaterial(i);
for ( int j = 0; j < irr::video::MATERIAL_MAX_TEXTURES; ++j )
{
if ( mat.Textures[j] )
{
//as sample
::AfxMessageBox( (LPCTSTR)(CString)mat.Textures[j]->getName().c_str() );
}
}
}
e.g.
Code: Select all
CFileDialog fd( TRUE, _T("3ds"), NULL, OFN_HIDEREADONLY ,
_T("3DS Files(.3ds)|*.3ds||"));
if ( fd.DoModal() != IDOK )
{
return -1;
}
else
{
//read in textures of fd.GetFileName() ?? :oops:
}