During the last weeks, I have integrated the Assimp library (http://assimp.sourceforge.net/) in an Irrlicht project.
Assimp is a library actively developed and maintained made to import/export 3D models in a lot of file fomats.
Assimp supports a lot of imports formats (more than 40), and it's useful in particular for animated meshes because Irrlicht doesn't support the most popular formats for that, like FBX or Collada.
Assimp can also export in 4 formats and only static mesh yet (like Irrlicht : Collada, obj, stl, ply), but more formats are available in the trunk version (3DS, Assimp format(binary/XML), DirectX (.x))
To use it :
- Download Assimp and add it to your project.
- Add the content of the IrrAssimp folder in your projet
- And the usage is very simple :
Code: Select all
// The assimp loader is in a separate system and not directly implemented as a meshLoader to give the choice to use Irrlicht or Assimp for mesh loading to the user, in function of the format for example
IrrAssimp assimp(smgr);
IAnimatedMesh* mesh = assimp.getMesh("Media/dwarf.x");
if(!mesh)
{
std::cout << assimp.getError().c_str() << std::endl;
device->drop();
return 1;
}
assimp.exportMesh(mesh, "obj", "Media/export.obj");
The code is on Github.