Import large STL mesh

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
Thulsa Doom
Posts: 63
Joined: Thu Aug 05, 2004 9:40 am
Location: Germany

Import large STL mesh

Post by Thulsa Doom »

Hello !

just got into some trouble loading a large mesh from an STL-Fileformat.
The following code works like charme for small STL triangle meshes:

Code: Select all

 
         IAnimatedMesh*
                 ani = smgr->getMesh( "D:\\resources\\Pendant_Seahorse-STL\\Pendant-Seahorse_Part2.stl" ); 
 
        IMesh*  stl =
                ani->getMesh(0); 
 
        IMeshSceneNode* node_stl =
                smgr->addOctreeSceneNode(stl);
 
Performing the same code on a larger STL throws up this error message in the debug console:

"Too many vertex for 16bit index type, render artifacts may occur."

Is there a way to import a larger triangle mesh, let's say about some million triangles?
Maybe I just miss the point and the topic was already covered elsewhere?

Please help.
krom
Posts: 17
Joined: Sun May 17, 2009 5:27 pm

Re: Import large STL mesh

Post by krom »

I would suggest to convert your model to ply format, It will enable you to load huge meshes.
if you want to keep the stl format you have to split it up into smaller pieces.

k
Thulsa Doom
Posts: 63
Joined: Thu Aug 05, 2004 9:40 am
Location: Germany

Re: Import large STL mesh

Post by Thulsa Doom »

krom,
thx for quick reply!

Well seems like the PLY format suffers from the same problem, if the above code is used.
Even more worse: In conjunction with an OctreeSceneNode even low poly PLY models are not displayed at all!

Using AnimatedMeshSceneNode discards for my purpose,
as OctreeSceneNode allows efficient intersection/collision implementation?

Anway, it would be good to know, if the OctreeSceneNode is the root of the problem.

regards

Doom
krom
Posts: 17
Joined: Sun May 17, 2009 5:27 pm

Re: Import large STL mesh

Post by krom »

Probably because OctreeSceneNode is limited by 16bit index..
guess only option is to split the mesh into smaller meshes below 65k triangles, then add them to IMetaTriangleSelector.

k
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Import large STL mesh

Post by hybrid »

This has been fixed in SVN/trunk (or maybe even in the 1.7 branch...) so will hopefully be working in the next Irrlicht release
Post Reply