www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: iguatemi on January 03, 2017, 05:51:49 pm

Title: Object3D.build appear to create more unique vertices. Why?
Post by: iguatemi on January 03, 2017, 05:51:49 pm
Hi, does anyone know why does Object3D.build appear to create more unique vertices? This is getting me into trouble when skinning.

Code: [Select]
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
Code: [Select]
Before build
Mesh Vertices: 4644
Mesh Unique Vertices: 786
Mesh Triangles: 1548
After build
Mesh Vertices: 4644
Mesh Unique Vertices: 794
Mesh Triangles: 1548
Title: Re: Object3D.build appear to create more unique vertices. Why?
Post by: EgonOlsen on January 03, 2017, 07:34:37 pm
These are for the bounding box. They belong to no triangles.
Title: Re: Object3D.build appear to create more unique vertices. Why?
Post by: AGP on January 03, 2017, 07:43:30 pm
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).
Title: Re: Object3D.build appear to create more unique vertices. Why?
Post by: EgonOlsen on January 03, 2017, 10:22:07 pm
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...
Title: Re: Object3D.build appear to create more unique vertices. Why?
Post by: AGP on January 04, 2017, 07:59:24 am
This is about the skinning issue. The point is that the vertices are NOT merging/welding. Should they be?
Title: Re: Object3D.build appear to create more unique vertices. Why?
Post by: EgonOlsen on January 04, 2017, 08:58:06 am
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() (http://www.jpct.net/doc/com/threed/jpct/Object3D.html#disableVertexSharing())