Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - iguatemi

Pages: [1]
1
Support / Re: Vertices order when adding triangles.
« on: January 10, 2017, 07:12:30 pm »
This is what we mean by "break".


2
Support / Re: Vertices order when adding triangles.
« on: January 06, 2017, 09:25:07 pm »
Thanks!

It actually worked disabling vertex sharing.

3
Support / Vertices order when adding triangles.
« on: January 06, 2017, 06:46:35 pm »
What is the order in which the vertices are sorted to the object3d when using addTriangles?

For example, if I addTriangle(vertex1, vertex2, vertex3), will the vertices be stored in the mesh in the order vertex1, vertex2, vertex3? Is there some logic to it or is it case-by-case?

4
Bones / Re: How to Fill SkinData
« on: January 03, 2017, 08:53:29 pm »
We have for the same model, two very different vertex counts (triple the number of triangles in jpct versus the unique vertex count which is typically less than the number of triangles in any given model), while retaining the same number of triangles, between jpct and 3ds max. But when we create our SkinData, we use only the number of unique vertices. Now we're thinking that we should be using the number of vertices in jpct. Did that make sense to you and do you agree?

5
Support / 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

6
Bones / Re: How to Fill SkinData
« on: December 23, 2016, 08:49:54 pm »
hey, raft. in some models, some vertices have more than 4 joints associated to them. do you have any input on how to handle these cases?

7
Bones / Re: How to Fill SkinData
« on: December 06, 2016, 05:38:34 pm »
Quote
you mean like sum of weights should be 1 per vertex? no there is no such requirement

great, thanks again :)

8
Bones / Re: How to Fill SkinData
« on: December 06, 2016, 04:26:32 pm »
Hi, raft.

Should the vertices' weights be normalized?
I didn't find any reference about it in the docs or in this forum.

Thanks

9
Bones / Re: How to Fill SkinData
« on: July 20, 2016, 11:50:37 pm »
Hey, guys.
I'm working with AGP and I got stuck.

About the weights and jointsIndices, I'm not sure if I got it right. Here is how I'm building the skin data:
Code: [Select]
float[][] weights = new float[vertices.size()][Skeleton.MAX_JOINTS_PER_VERTEX];
short[][] jointIndices = new short[bones.size()][Skeleton.MAX_JOINTS_PER_VERTEX];
int[] weightCounters = new int[vertices.size()];
int[] jointIndicesCounters = new int[bones.size()];

for (BoneReference aBoneRef: boneRefs) {
    int weightCounter = weightCounters[aBoneRef.vertexIndexReference];
    if (weightCounter < Skeleton.MAX_JOINTS_PER_VERTEX) {
        weights[aBoneRef.vertexIndexReference][weightCounter] = aBoneRef.vertexWeight;
        weightCounters[aBoneRef.vertexIndexReference]++;
    }
    int jointIndicesCounter = jointIndicesCounters[aBoneRef.boneIndexReference];
    if (jointIndicesCounter < Skeleton.MAX_JOINTS_PER_VERTEX) {
        jointIndices[aBoneRef.boneIndexReference][jointIndicesCounter] = aBoneRef.vertexIndexReference;
        jointIndicesCounters[aBoneRef.boneIndexReference]++;
    }
}

Everything goes well untill I try to  applySkeletonPose. I get index out of bounds.

Code: [Select]
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 249
at raft.jpct.bones.Animated3D.applySkeletonPose(Animated3D.java:523)
at Importer.loop(Importer.java:344)
at Importer.<init>(Importer.java:56)
at Importer.main(Importer.java:422)


I'm using the SkeletonDebugger to check the bones and they're look fine.

Do you have any idea on how to make it work?

Thanks!

Pages: [1]