I’m not clear on what you’ve got there, I think maybe a typo as your first example of what I’ve got isn’t what I’ve got. I only increment the colors per triangle, as I understand it, incrementing colors per vertex would change the colors for every vertex position and they all need to be the same color.
Also, when I do a readPixel, the triangle that gets highlighted jumps all over the place as if it were getting 3 random vertices from my model. That part might be too complicated to post so I’ll just keep at it, but the colors I don’t understand why they’re not right.
I try to clarify how my colors are done here. I did change indices as you suggest and now see more colors. Before I thought all the empty triangles were just shades of black I couldn’t see and my drawNormally after drawColorCoded fooled me into thinking they were being drawn. I think my next important step is getting the tri’s all solid colors.
I do quesiton this line, am I understanding this correctly.
// 3 colors and we store 32 bit ints for each color w/ putInt?
ByteBuffer cBuffer = BufferUtils.newByteBuffer(3 * 4);
for (each triangle) {
int idx = 0;
for (int i = 0; i < 3; i++) { // loop vertices of a single triangle
// ...
cBuffer.putInt(idx, getRed());
triBuffer.put(idx++, (float) node.getX());
cBuffer.putInt(idx, getGreen());
triBuffer.put(idx++, (float) node.getY());
cBuffer.putInt(idx, getBlue());
triBuffer.put(idx++, (float) node.getZ());
// by not incrementing colors inside this loop, R, G, and B stay same color.
indicesBuffer[i].put(index++);
indicesBuffer[i].put(index++);
indicesBuffer[i].put(index++);
}
colorBuffer[i].put(cBuffer); // add 9 colors per 9 vertices of this triangle
elementBuffer[i].put(triBuffer); // add 9 vertices of this triangle to array
incrementColor();
}