Object3D.build appear to create more unique vertices. Why?

Started by iguatemi, January 03, 2017, 05:51:49 PM

Previous topic - Next topic

iguatemi

Hi, does anyone know why does Object3D.build appear to create more unique vertices? This is getting me into trouble when skinning.


Mesh aMesh = anObject.getMesh();
System.out.println("Before build");
System.out.println("Mesh Vertices: " + aMesh.getVertexCount());
System.out.println("Mesh Unique Vertices: " + aMesh.getUniqueVertexCount());
System.out.println("Mesh Triangles: " + aMesh.getTriangleCount());

System.out.println("After build");
anObject.build();
System.out.println("Mesh Vertices: " + aMesh.getVertexCount());
System.out.println("Mesh Unique Vertices: " + aMesh.getUniqueVertexCount());
System.out.println("Mesh Triangles: " + aMesh.getTriangleCount());


Output

Before build
Mesh Vertices: 4644
Mesh Unique Vertices: 786
Mesh Triangles: 1548
After build
Mesh Vertices: 4644
Mesh Unique Vertices: 794
Mesh Triangles: 1548

EgonOlsen

These are for the bounding box. They belong to no triangles.

AGP

What about the number of what must be duplicate vertices? For instance, we have a model with 786 unique vertices. Its Mesh, however, has 4644 vertices (while the number of triangles is the same between jpct and 3ds max).

EgonOlsen

I'm not sure what your actual question is here!? It merges vertices when it can and you haven't turned it off, sooo... that's what it does here, too...

AGP

This is about the skinning issue. The point is that the vertices are NOT merging/welding. Should they be?

EgonOlsen

Still...I'm not sure what you mean!? Which "skinning issue"? Where do the vertices fail to merge? They do merge (unless you don't want that), if they are equal. That's all that happens.

Edit: To disable the merging: http://www.jpct.net/doc/com/threed/jpct/Object3D.html#disableVertexSharing()