As the title suggests, I am trying to find the height of an arbitrary point in a triangle given the height of the vertices of that triangle. The triangle would be a polygon in a height map and the point I need to find would be the height I need to assign to the player.
I have searched methods like Barycentric Coordinates and Bilinear Interpolation, but I can't seem to find how to actually implement them using C#.
Here is a visual of what I am trying to find:
I am trying to find the height of the red dot using the heights of the vertices, which in this case are 4, 5 and 2