0
$\begingroup$

I found this post...

Find coordinates of a 2D plane within a 3D plane

Edit: I rewrote the following for clarity...

I want to translate real-world X, Y, Z coordinates in 3d modeling software to an arbitrary 2d plane that lies within the 3d system of the software. All points in this problem will lie on the arbitrary 2d plane but are expressed as 3d points within the 3d system. I want the points expressed as 2d points within the 2d Cartesian plane, which has its own origin.

This is my best guess implementation, but I do not know if it works in all situations:

$x_o, y_o, z_o$ = given origin point of 2d plane expressed as a point in the 3d system.

$(X_u, Y_u, Z_u)$ = The transform for the 2d plane Y-direction/upwards vector relative to the 3d system; e.g. (0,0,1)

$(X_r, Y_r, Z_r)$ = The transform for the 2d plane X-direction/rightwards vector relative to the 3d system; e.g. (1,0,0)

$x_1, y_1, z_1$ = given coordinates for a point in the 3d system that lies on the 2d plane

$x_2, y_2$ = x, y of the above point as expressed as a point on the 2d Cartesian plane.

Equations:

$$x_2 = (X_r(x_1 - x_o) + Y_r(y_1 - y_o) + Z_r(z_1 - z_o))$$

$$y_2 = (X_u(x_1 - x_o) + Y_u(y_1 - y_o) + Z_u(z_1 - z_o))$$

Not remembering my high school math on the matter, I literally figured these equations out from scratch on a sheet of graph paper, so I have no idea if they are valid.

Any help is appreciated.

$\endgroup$
6
  • $\begingroup$ Imo this is quite hard to read.. a sketch of a drawing will surely clear things up and get you more interested helpers $\endgroup$ Commented Jan 30, 2020 at 20:22
  • $\begingroup$ Not sure the best way to do that. I think my solution works tho. $\endgroup$ Commented Jan 30, 2020 at 21:47
  • 1
    $\begingroup$ Please format your mathematical expressions using MathJax. $\endgroup$ Commented Jan 31, 2020 at 17:09
  • $\begingroup$ Finding a suitable transformation is a straightforward computation, but b you can talk about transformations at all, you need to choose a coordinate system for the plane. This amounts to choosing a point on the plane as the origin and two vectors that define direction and unit length of the coordinate axes. These are arbitrary choices. Now, there might be some properties that you want this coordinate system to have, such as othonormality, and you probably have some idea of how you want it to relate to the original 3D coordinates... $\endgroup$ Commented Jan 31, 2020 at 18:21
  • $\begingroup$ It seems like you have something in mind along those lines, but it’s quite vague in your question. You need to firm up these criteria and make them explicit. $\endgroup$ Commented Jan 31, 2020 at 18:23

2 Answers 2

1
$\begingroup$

Let $(x_0, y_0, z_0)$ be the plane origin in 3D space; $(x_U, y_U, z_U)$ be the direction of the plane $u$ axis in 3D space; $(x_V, y_V, z_V)$ be the direction of the plane $v$ axis in 3D space, perpendicular to the $u$ axis; and point $(u, v)$ on the 2D plane corresponding to the same point $(x, y, z)$ in 3D space: $$\begin{cases} x = x_0 + u ~ x_U + v ~ x_V \\ y = y_0 + u ~ y_U + v ~ y_V \\ z = z_0 + u ~z_U + v ~ z_V \\ \end{cases}$$ Conversely, $$\begin{cases} \displaystyle u = \frac{(x - x_0) y_V - (y - y_0) x_V }{ x_U y_V - x_V y_U } = \frac{(x - x_0) z_V - (z - z_0) x_V }{ x_U z_V - x_V z_U } = \frac{(y - y_0) z_V - (z - z_0) y_V }{ y_U z_V - y_V z_U } \\ \displaystyle v = \frac{(y - y_0) x_U - (x - x_0) y_U }{ x_U y_V - x_V y_U } = \frac{(z - z_0) x_U - (x - x_0) z_U }{ x_U z_V - x_V z_U } = \frac{(z - z_0) y_U - (y - y_0) z_U }{ y_U z_V - y_V z_U } \\ \end{cases}$$ In a numerical application, first calculate the divisors, $x_U y_V - x_V y_U$, $x_U z_V - x_V z_U$, and $y_U z_V - y_V z_U$, and use the two with the highest magnitude. This way you get best numerical stability.

(That corresponds to using the two 3D coordinate axes most similar to the 2D plane $u$ and $v$ axes; i.e. dropping the 3D coordinate axis closest to perpendicular to the 2D plane.)

$\endgroup$
1
  • $\begingroup$ @ Anonymous Coward Is this more accurate than my solution? My solution seems to work when the plane aligns with one of the 3d system axes. But I have not tested planes at arbitrary angles relative to the 3d system axes. $\endgroup$ Commented Feb 3, 2020 at 18:36
0
$\begingroup$

If I understand your problem, is it closely related to the calibration of a 3D scanner? Or perhaps the operation of a camera? If so, both of these have extensive descriptions in publically available documents that might be just what you need.

(I am not qualified to make a comment, yet, so I had to add this answer instead.)

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.