Note that there are some explanatory texts on larger screens.

plurals
  1. POInverse 3D (triangle) projection
    text
    copied!<p>I have a 3D math problem which I just can't seem to solve.</p> <p>I have data of 3 points. The data is a (2D) coordinate on a plane, floating somewhere in 3D space. I also know the (2D) coordinate of the projection. That results in the following array of data:</p> <pre><code>[[[x1,y1], [px1,py1], [[x2,y2], [px2,py2], [[x3,y3], [px3,py3]] </code></pre> <p>Where the normal (x1 etc.) coordinates stand for the coordinates on the plane and the other (px1 etc.) for the projected coordinates.</p> <p>What I would like to do is project a <em>new</em> 2D coordinate ([x4,y4]).</p> <p>.</p> <p><strong>What I tried so far:</strong></p> <p>Ofcourse you need an eye for projection, so I set that to [xe,ye,-1]. The xe and ye are known. (It is photo referencing, so I just placed the eye in the center of the photograph.)</p> <p>Beneath the eye I placed the projection surface (z=0). That gives the following projection coordinates:</p> <pre><code>[[[x1,y1], [px1,py1,0], [[x2,y2], [px2,py2,0], [[x3,y3], [px3,py3,0]] </code></pre> <p>I can't do the same for the coordinates on the plane, since I don't know anything about that plane.</p> <p>I also figured that I could make a parameterized formula of the lines running from the eye through the projection coordinates. For line1 that would be:</p> <pre><code>line1x = xe+(px1-xe)*t1 line1y = ye+(py1-ye)*t1 line1z = -1+t1 // = -1+(0--1)*t1 </code></pre> <p>I also know the distance between the points in 3D. That's the same as in 2D. That means the distance between point1 and point2 would be sqrt((x1-x2)^2+(y1-y2)^2).</p> <p>I also know the distance between the lines (line1 and line2) at any time. That is sqrt((line1x-line2x)^2+(line1y-line2y)^2+(line1z-line2z)^2).</p> <p>However, I don't really know how to go from here... Or even whether this is the right route to take.</p> <p>.</p> <p>I hope you understand what I want to be able to do, and that you can help me.</p> <p>Thanks in advance!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload