I never did it myself, but I see 2 methods… One easy (not efficient actually), and one a bit trickier…

btw I’m pretty sure they are better methods!

## EASY METHOD :

(1) find the triangle above which you are (work with 2D coords)

(2) do the calculations depending on your exact position using gradients (in 3D)

## TRICKY METHOD :

When you move, if you go out of the triangle above which you were, just consider the ones next to the previous triangle. If you can’t, you probably moved too quickly (in that case, seek among all the triangles). ** This method require that you keep an array of pointers to a list in which you describe what are the triangles next to another one … So begin with the first method, and when it works, if it’s slow you’ll be able to optimize…