as a little exercise i tried to patch a basic ear clipping algo that is able to triangulate a simple polygon.
the algorythm interates through a list of 2d points, check each of them if it meets the condition and if the first one in the list meets the condition this point will be deleted in the list, and the loop restarts with the remaining points, until no points are remaining anymore.
the problem i have now, is that each time the loop restarts, this will be done in a new frame within the mainloop. i want this all be done within one frame. no idea how to achieve this. please see the attatched patch (i slowed down the mainloops to make visible what happens)
thx bjoern, but i think theres a problem with that simplified aproach. i think its because the repeat loop index doesnt return the zero once it found a result but continues from its current index. in certain cases that can lead to wrong triangulation. i put my method with the break and yours next to each other to compare…
maybe the solution would be something like that each time it founds a result the index gets stored and substracted from itself in the next iteration of the loop… not sure.