#Why does the order of vertices matter?

8 messages · Page 1 of 1 (latest)

frail iris
#

In my mod, I was drawing a circle using TRIANGLE_FAN, but it wasn't appearing for me, so I did some testing. What I found out was, the order of how you define your vertices matters. For reference, number 2 works, number 1 doesn't

// This doesnt work
bufferBuilder.vertex(matrix, 100, 100, 0).color(255, 255, 255, 255);
bufferBuilder.vertex(matrix, 200, 100, 0).color(255, 255, 255, 255);
bufferBuilder.vertex(matrix, 200, 200, 0).color(255, 255, 255, 255);

// But this does
bufferBuilder.vertex(matrix, 100, 100, 0).color(255, 255, 255, 255);
bufferBuilder.vertex(matrix, 200, 200, 0).color(255, 255, 255, 255);
bufferBuilder.vertex(matrix, 200, 100, 0).color(255, 255, 255, 255);
bold mortar
#

yes

#

i believe it defaults to counter clockwise for the vertex order

#

yeah

#

if you curve your right hand in the order of the vertices, your thumb should point to you

frail iris
#

ik what counter clockwise is

#

Is there are way to change the direction or even disable this limitation?

bold mortar
#

you can disable back face culling, but its better to just build your vertices in the correct order