I have a grid-based map system. The grid is aligned to the X and Z axes. The tiles on said map are 3-dimensional, but flat, and can be located anywhere on the Y-axis.
If I need to get a Vector3 of the middle point of any extremity edge of the mesh of any given tile, how would I do that?
Update: adding further detail to elaborate further,
being as I am trying to find the middle point of 2 axes ON the edge of the mesh, it cannot be the average of all vertices on the edge. Example below:
Taking the above polygon as the example, assume that we are trying to find the middle point of the left-most edge (the edge with the smallest x value).
There are 3 vertices on this edge: (0, 0, 0) (0, 0, -0.52) (0, 0.3, -1)
Being as we are trying to find the point on a given edge, we can solve for 2 axes fairly easily. The X-axis will be at 0, being as we have chosen this edge. The Z-axis will be the average of the smallest and the largest vertices divided by 2 for the middle point of this axis. But the Y axis is going to vary for every possible permutation. If we took the average of all of our given Y values in this example, the result would be 0.1 - however, looking at the example, I know that the desired result should be 0, because I am searching for the middle point on the mesh edge, and at 0x, -0.5z, the edge is at 0y.
How do I solve this for any given potential problem like this?