what i have:
- a node, containing other nodes, meshes, texture coordinates, everything is made of triangles
- this code:
private void scatter(final TriangleBatch p_trBatch) {
final int l_triangleCount = p_trBatch.getTriangleCount();
final Vector3f[] l_allVerts = p_trBatch.getMeshAsTrianglesVertices(null);
for (int j = 0;j<l_triangleCount;j++)
{
for (int i = 0; i < p_trBatch.getTriangleCount();i++) {
TriMesh l_triMesh = new TriMesh
(
"I am a triangle",
BufferUtils.createFloatBuffer(l_allVerts[i*3+0], l_allVerts[i * 3 + 1], l_allVerts[i * 3 + 2]),
);
}
}
}
what i want to do:
move every triangle, keeping the normal and tex coords, indepently from each other. for example, i take one triangle, move it by 1,0,0, then take the next one, move it by 2,0,0 and so on. i also need to remove the old node for reasons that don't matter here.
for this, i need to access the triangle data contained deep in a node. i already found a way to get them, but as you can see, i still need to extract the normals, colors, tex coords and so on. i don't know how the data is stored and there is no method to extract it like i could do with the triangle vertices. it might be a triangle strip, might be indexed, might be whatever it might be.
do i have to make a huge if/elseif/elseif here, or is there a more efficient way to do it?