taking a mesh into consideration.
If I want to see all triangles a vertice is attached to, I did the following.
Loop start until triangle.length
if myVertice == mesh.vertices[triangle*] // found the same vertice in anouther or the same triangle*
This works, but I don’t like the idea of itirating to all Vertices for triangle length every time. Is there another way to solve this Problem? Thanks, Sinith
If this actually causes you performance problems, you can always use the solution of " use more memory".
-At startup: build an array the same size as your mesh vertex array.
-Each element of this array stores a set/list of triangles the vertex belongs to.
-Once built, you can simply index to this array (using the vertex index) to get the list of triangles the vertex belongs to, without any need to loop.
I am still in the design phase and going through some ideas and tests before blueprinting everything.
Well the idea is to do a 3d pathfinding on a big sphere and I need this - find the vertices near me - feature. I want to have several objects doing this pathfinding simultaneously and they have to check on every vertices the next near vertices… So I guess this can cause some performance issues. So I could just set it up and then go for “just more memory” solution…
What I have been doing the last hour was to create a sphere from scratch. Here I have the solution to assign each vertices a latitude and a longitud. Just like earth I can calculate very easy the vertices next to the one the characters are currently on.
I just though maybe there is a neat little function that finds the vertices and triangles of near the current one.
Or maybe I just asked the question wrong.
Reading out Glurth answer now… this is a good approach as well. would definitely save up some time. I’ll look into that.