# Vertices array in mesh vertices

Is there a specific way that unity adds vertices to the mesh.vertices array? Does it differ from mesh to mesh/program to program/ or is it just random altogether(or based on many variables)? I guess all the tools are there for me to determine that the index is of each vertex in a specific mesh, but if they are added to the array in a specifc order i can cut down uv/normal calculations(this would be very optimal if you can hint to how unity handles importing a meshes vertices).

Im still working out the whole uv/normal calc for each vertex using references here from other answers like: @bunny83 's post about subdividing and @Statement 's post about fetching triangles. I actually got inspired by Lasse 's answer to @Fattie 's question about finding nearby triangles, which is basically exactly what i am doing. I want to set up a tree for an equal planes triangles(unitys built-in plane for now)(quadtree built from Start() ?) , i suppose thats the most relevant part of my question/inquiry other than order of vertices in the mesh.vertices array.

Sorry for the compacted question/answer post, hopefully it will inspire others as it has me. I look forward to your insight on this, ive been pondering this question for days now and just trying to figure out the best method before i type it all out(cuz ill probly get lazy and not continue research if i type it out first, at least 'til it becomes a problem :P).

There’s no order other than what you supply. If you say “mesh.vertices = [Vector3(1, 1, 1), Vector3(2, 2, 2), Vector3(3, 3, 3), Vector3(4, 4, 4)];”, then that’s the order. If you’re asking does Unity rearrange them for any reason, then no, it doesn’t.

You have hit on an incredibly critical point here, jinx.

(1) Unity merely uses 3D models, it does not make or decide on them in any way.

It’s important to note that even very sophisticated programmers often misunderstand this.

For example,

Note that someone was saying: “It is an absolutely true statement that Unity shares vertices where it can. There is no situation where this is not true.” … that statement, is utterly incorrect.

but more importantly - the statement doesn’t even make sense. It would be exactly like saying “Microsoft Word only produces crime novels where possible, it never produces action novels” It simply: makes no sense. You could MAYBE say something like “MAYA shares vertices where it can”. (That claim would be totally incorrect and demonstrate a misunderstanding of 3D models.) But the sentence “UNITY shares vertices where it can” is just utterly meaningless - UNITY is to 3D models as your Laser Printer is to Novels. Your laser printer does not make any decisions on anything such as the plot or characters in your novel

Moving on to the meat of your question.

(2) There is absolutely no - utterly no, whatoever - “rules” about vertex placement in 3D models.

it is very mportant to understand this, and again, even many sophisticated people do not understand this. People not unreasonably think that 3D models must “understand” surfaces, or that 3D models have verts in some arrangement. Again it is totally untrue.

Finally! the true meat of your question!! As you said I’m basically trying to create a quick reference for touching tris…