Recently I got into procedural mesh generation and I took a look at how the Unity engine sets the vertex and triangle order in a cube. What I’m the most curious about is why some of triangles use “out of the order” vertices?
My question is: why does the 3rd and 4th triangle use vertex 4 and 5 instead of 10 and 11? As the first two triangles (that make up the Back side) use 0,1, 2 and 3 vertices.
Is it because how the vertices are serialized, deserialized or for another reason?
Thank you for any help or thoughts about this matter
Because the model was one created and imported into Unity 15 years ago and no one really gave it much thought then, and it’s existing mostly unchanged since then?
Yes, that is a possibility, still I would like to think the Unity engineers selected this order for a reason not just arbitrarily defined the triangles in that order.
@dolinkamark If you are looking into procedural mesh generation, why does the point order of Unity’s cube matter to you? Just wondering. I think it’s best you pick a point order that works best for you.
@Olmi it doesn’t matter at all to know that, I’m just curios.
I know that in mesh generation any order would work as long as you set the vertex order by in the triangles array so it is clockwise from the side you want it to be visible and you recalculate the normals for the lighting and bounds for mesh collision.
The fact that there are so many options that made me curios about why Unity engine picked this specific order for the vertices and triangles (mostly this one).
For vertices, it makes sense that they go along z,y,x axes from positive to negative direction. But the triangle order made me post this question. (I know I’m much more invested in this than it would be healthy )
there is a free procedural primitive asset pack on the asset store.
They may have indexed more sensibly.
These things seem silly to some, but I finally got the hang of triangle wrapping after being terrified of it for over a decade, and to me, every little detail is extremely important,especially when it comes to procedural generation. So I don’t think this question is silly at all.