I've MOSTLY got this working for a starting point, but 8 faces aren't being filled in. I suspected it was probably due to listing some of the vertices in CCW order when CW order is specified. I used different easily identifiable colors to figure out which vertices weren't having the corresponding faces being drawn (each face has vertices of unique color), and simply tried just reversing the order, but the particular face didn't show up.
For example, one of the faces missing has vertices colored: green (3), red (0,9), and white(6,8). The only face that has each of those vertices is the (3,9,8) face, but when changed to (8,9,3) the face still doesn't show (even though it should now be in CW order if it wasn't before).
- Code: Select all
float[] colors = {
1f, 0f, 0f, 1f, //red 0
1f, 1f, 0f, 1f, //yellow 1
1f, 0f, 1f, 1f, //pink 2
0f, 1f, 0f, 1f, //green 3
0f, 1f, 1f, 1f, //l.blue 4
0f, 0f, 1f, 1f, //blue 5
1f, 1f, 1f, 1f, //white 6
1f, 1f, 0f, 1f, //yellow 7
1f, 1f, 1f, 1f, //white 8
1f, 0f, 0f, 1f, //red 9
1f, 1f, 0f, 1f, //yellow 10
0f, 0f, 1f, 1f, //blue 11
};
//faces - clockwise
short[] indices = new short[] {
1, 2, 6, //
1, 7, 2, //
3, 4, 5, //
4, 3, 8, //
6, 5, 11, //
5, 6, 10, //
9, 10, 2, //
10, 9, 3, //
7, 8, 9, //
8, 7, 0, //
11, 0, 1, //
0, 11, 4, //
6, 2, 10, //
1, 6, 11, //
3, 5, 10, //
5, 4, 11, //
2, 7, 9, //
7, 1, 0, //
3, 9, 8, //error? (based on color assignment)
4, 8, 0, //
};
I've attached the whole file incase it helps. I can supply the rest of the program if needed.
Thanks in advance for any input.


