Sign in to follow this  
jonathanschmidt

one special point from plane and 3 points

Recommended Posts

Hello, I've got a mathematical problem: I've got three 2D points, each of them has a 3d point associated with it. All three 3d points are on the same plane in 3d space. (The 2D points are texture coordinates, the 3d points are the positions of their vertices). Now, I've got a fourth 2D point, somewhere. And I would like to know, where its assosiated 3D point would be. Hope this explanation is understandable. I would like to know if this problem can be solved, and if so, how. Does somebody know a solution for this?

Share this post


Link to post
Share on other sites
Atheist    150
Definitely solveable if I undestood you correctly. My first idea for a solution (short version because I am tired):

P4 = P1 + a(P2-P1) + b(P3-P1)
the plane equation in it´s explicit form with Pn being the coordinates (coordinate vectors) of point n is true in 2D as well as in 3D, so:
1) with the 2D-coordinates Pn -which you know all n=1..4 of- calculate a and b.
2) plug a and b in the equation with the 3D-coordinates to determine P4.

Share this post


Link to post
Share on other sites
Ah, thanks for this fast response. I already thought about doing it this way, but I think I am just too stupid to get a and b. I'm currently doing it this way, but maybe I just have a thinking error somewhere:

a = ((P4 - P1) . (P2-P1)) / ( |(P4-P1)| * |(P2-P1)|)
b = ((P4 - P1) . (P3-P1)) / ( |(P4-P1)| * |(P3-P1)|)

Share this post


Link to post
Share on other sites
VolkerG    151
Ok, I don't understand your formula. The general case is a little bit complicated and will follow in badly typed HTML very soon.

Let us define p=P4-P1, u=P2-P1 and v=P3-P1.
The original equation is p = su+tv.
Multiplying by u gives us
I: pu=suu+tuv.
When using v instead we get
II: pv=suv+tvv

Now I.vv-II.uv gives us
s=((pu)(vv)-(pv)(uv))/D
where
D=(uu)(vv)-(uv)(uv).
t can be calculated the same way.
Both formulas become easier if u and v are orthogonal.
Try this, I hope it is correct.
Btw. this formula will only work if P4 is on the plane, but that's the case here, if I understand you correctly.
[Edit] Fixed braces in the formula for s.

[Edited by - VolkerG on July 8, 2004 5:54:42 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Ah, thanks, I guess this would do it. I currently solved it by calculating the intersection of P4+u and P1+v and getting the lenght of the two vectors to the intersection.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this