I know this is basically a 5th grade math problem, but I'm very rusty and I was hoping there is a way to solve this thing directly.
Background: I am working on a system that morphs clothing meshes based on the (dynamic) morphing/deformation of their underlying reference body mesh. The best I could come up with is to map every clothing vertex to a body triangle in advance and use this data to later shift the vertices with their triangles. My guess is that results will be smoothest, if I keep the relative position of the vertex on the triangle plane, which can be outside the triangle area, if there was no better match to be found. For this, I want to determine x and y, so I can later "restore" them. With triangle positions being t1, t2 and t3, V1 = t2 - t1, V2 = t3 - t1 and V3 = ClothingVertPos - t1 (projected onto the triangle plane).
Speed is not an issue, because this gets prepared ahead of time.