Jump to content
Posted 07 March 2013 - 10:01 PM
Posted 08 March 2013 - 04:42 AM
I assume the two triangles lie in a square grid-cell and are connected by a single edge?
If so, first check on which side of the connecting edge the point lies: dot(point - pointOnEdge, cross(float3(0, 1, 0), edge) > 0).
Then plug the x and y values into the overlapping triangle's plane equation. (a*x + b*y + c*z = d) => y = (a*x + c*z - d) / -b.