how can i get textures of an 3DS File ?? [Windows MFC]

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
vizzy
Posts: 10
Joined: Mon May 21, 2007 2:55 pm
Location: Dresden, Germany

how can i get textures of an 3DS File ?? [Windows MFC]

Post by vizzy »

first: sorry for an noob question and my bad english.
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() );	
			}
		}
	} 
but how can i read the textures of an selected file ?
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: 
   }
Thanks for your reply and help...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You mean you want to read the texture names from the 3ds file? You'd have to parse the file for that. At least that's what Irrlicht does to grab all the information. But why not loading the mesh (without displaying it) and query the mesh?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

if you really want to parse the file on your own you can look how Irrlicht does it in the source code file C3DSMeshFileLoader.cpp...

or you can look how 3ds files are build, a reference can be found here:
http://www.wotsit.org/list.asp?fc=2
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
vizzy
Posts: 10
Joined: Mon May 21, 2007 2:55 pm
Location: Dresden, Germany

Post by vizzy »

..thanks acki, your link help
Post Reply