Loading Models with duplicated Vertices

HI,

my problem is that the jme asset loader removes some vertices that are stored in my obj file.

Ex. i have 4000 vertices in my file but only 3900 will be loaded.

my guess is that 100 of the original 4k vertices aren’t unique and discarded in the loading process.



now the question. is it possible to load all vertices(and corresponding indices) of my obj files with the basic assetManager or do i have to write my on obj-loader?

(and yeah it is important to load all vertices even if they aren’t unique)

what do you mean about “aren’t unique”?

I don’t think the obj loader discards any vertex (afaik, and i could be wrong… but really i don’t think so…).

It’s quite hard to guess what is your issue because you’re making a lot of assumptions on what’s happening, but without really reporting the error you got. (if any?)

Also i’m almost sure that @Momoko_Fan at some point will pop in and ask you to upload your model so that he can test it and find out where is the problem.

so please, upload your model somewhere, and provide a link to it, it will save time for everyone.



Also i’ll link you to this interesting thread http://hub.jmonkeyengine.org/groups/site-project/forum/topic/asking-good-questions/ that is illustrating my point

2 Likes
@nehon said:
Also i'll link you to this interesting thread http://hub.jmonkeyengine.org/groups/site-project/forum/topic/asking-good-questions/ that is illustrating my point


Nice point ;) .

Yes the obj loader does discard identical verts, if they are exactly the same they won’t be loaded. Are you experiencing any artifacts because of it?

No error, no artifacts. the mesh itself is perfectly fine.

my problem is that i wanna compare two slightly different meshes with the same amount of vertices. but the comparison will be quite difficult if the meshes won’t be loaded with the same number of vertices and same indices. since i can’t just iterate the position list to compare positions to find out the difference between the two meshes i would have to manually check which points might be missing etc.



The Problem here lies within the computing speed of these additional calculations. thats why i’m asking if there is a possibility to load the files without discarding any identical vertices.

The vertex reduction in the OBJ loader cannot be removed I am afraid, because the OBJ format uses several index lists for each type of data (position, texcoord, normal) which is incompatible with jME3/OpenGL. This makes it impossible to keep the same vertex count since there could be various combination of these data, each of those combinations emits an individual vertex.

@Momoko_Fan said:
The vertex reduction in the OBJ loader cannot be removed I am afraid, because the OBJ format uses several index lists for each type of data (position, texcoord, normal) which is incompatible with jME3/OpenGL.

too bad :/
hoped there was a jme possibility but well i have to try and find my own solution for the problem

thx Momoko_Fan