How to get a p2 position?

I provided a P1 position and Region_3d Only.

Look at below a two same image.

Please answer to me.

Thank you.

How to get a p2 position?

I provided a P1 position and Region_3d Only.

Look at below a two same image.

Please answer to me.

Thank you.

This projection equation seems legit, but I didn’t test it out myself.

The intuitive explanation is that your point P1 is some distance away from your region. If find out how far away it is, then you can just move P1 that distance toward your region and that is your P2.

You just need the region normal and a point in the region. I recommend taking the first vertex in the region. The normal at that point should also be available.

v = position of first vertex in your region

n = normal at that vertex from the region

Then: P2 = P1 - dot(P1-v, n) * n

Beware that this might produce a point that is not actually in your region, once you have P2 you will have to test that is is actually bounded by your edges.