Huge .obj or not ?

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
LeGars
Posts: 8
Joined: Thu May 11, 2006 1:57 pm

Huge .obj or not ?

Post by LeGars »

Hello,

I have two obj file. One big, one small. The big one got 20860 vectors, and 20572 faces. The small one 7254 and 7084.
When I load load the big, Irrlicht says it got 82288 vertex and 123432 indices and 28336 vertex, 42504 indices for the small.

I understood the vertex count (each faces is composed with 4 vectors) but not the indice count...

The problem is that when I load the big one, the mesh is not complete. I only get a part of it.

This is how I load mesh :

Code: Select all

AnimatedMesh AniMesh = scene.GetMesh("bigmesh.obj");
Mesh mesh = AniMesh.GetMesh(0);

...

SceneNode node = scene.AddMeshSceneNode(mesh, null, -1);

Did I forget something ?

Thanks for any advice.

PS I know it's C#, but I don't think I should be the cause... I hope...
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

If there are more than 65535 vertices in a mesh, you will have problems with it. This is caused by the 16-bit index buffer issue that you have probably read about. If not, you could do a search...

It sounds like the .obj loader is duplicating verticies, possibly unnecessarily. CuteAlien posted some code a few months ago to weld duplicate vertices. You might try running that code on the mesh that is loaded by Irrlicht. The code is available here. You _should_ be able to write the same code in C#.

Travis
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Does this file format separate texture coords from vertices? If so then I could imagine, for example, a cube having 8 vertices in an obj file but 24 when loaded into Irrlicht - if all faces have different textures then vertex duplication is required.
Post Reply