Author Topic: Object3D.build appear to create more unique vertices. Why?  (Read 459 times)

Offline iguatemi

  • byte
  • *
  • Posts: 9
    • View Profile
Object3D.build appear to create more unique vertices. Why?
« 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
« Last Edit: January 03, 2017, 07:36:40 pm by iguatemi »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Object3D.build appear to create more unique vertices. Why?
« Reply #1 on: January 03, 2017, 07:34:37 pm »
These are for the bounding box. They belong to no triangles.

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
Re: Object3D.build appear to create more unique vertices. Why?
« Reply #2 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).

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Object3D.build appear to create more unique vertices. Why?
« Reply #3 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...

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
Re: Object3D.build appear to create more unique vertices. Why?
« Reply #4 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Object3D.build appear to create more unique vertices. Why?
« Reply #5 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()
« Last Edit: January 04, 2017, 11:03:13 am by EgonOlsen »