0
$\begingroup$

I'm trying to find a way of converting a point relative to the world into a point relative to an arbitrary plane (and a way to convert back). This will be coded into C++ so I'll have to able to write functions for your answers $:)$

In 3d-space, my plane defined by $ax + by + cz + d = 0$, where $(a,b,c)$ is a normalised vector, and my world point is $P(x_p,\ y_p,\ z_p)$. I'd like to find a way to convert the 'world point' from the World plane which has centre $(0, 0, 0)$ and normal $(0, 1, 0)$, into a 'local point' relative to my plane having centre $(x_c,\ y_c,\ z_c)$ and normal $(a, b, c)$.

I attempted to discern this function myself, and I came up with calculating the distance from the origin to the world point and the direction from origin to world point. From that, I could then position the point that distance away along the line formed by combining the plane normal and the line direction. Unfortunately, that's where I got stuck as I couldn't work out a suitable operation.

(NB: my mathematics level is probably rather rudimentary compared to the average on here - while I have a relatively firm grasp on vectors I don't have much experience or confidence with matrices, which I unfortunately suspect may be involved in the answer)


Edit: Having read through your comments and answers and thinking about what I mean I've come to the conclusion that I'm not even sure of the question myself. There's at least two different interpretations I've confused myself with in the last 10 minutes... I think perhaps the best way forward is for me to completely rethink what I'm trying to do and not post questions late into the night. Thank you for your help, anyway :)

  • 1
    Is this computer graphics? You can let $(0,0,0)$ be the eye of observer and $z=1$ be the screen. For any point $(x,y,z)$, the line $l$ connecting $(0,0,0)$ and $(x,y,z)$ will intersect the $z=1$ plane at some point $(a,b,1)$. Is that what you want?2012-04-12

1 Answers 1

1

I conjecture you have points ${\bf x}=(x,y,z)$ in $3$-space and you are given their orthogonal projection {\bf x}':=P_y({\bf x})=(x,z) onto the "world plane" $y=0$. If you just have {\bf x}', the $y$-coordinate of your point ${\bf x}$ is lost, and there is no way to get it back: All points ${\bf x}=(x_0,y,z_0)$, $-\infty, project onto the same point {\bf x}'=(x_0,z_0).

Now you are considering in addition a fixed plane $\pi\colon\ ax+ by+cz +d =0$, and you are envisaging a certain projection $P\colon \ {\mathbb R}^3\to\pi$ of $3$-space onto this plane $\pi$ (you have not specified this projection; maybe it is assumed to be orthogonal, maybe it is a "perspective"). As soon as you specify geometrically what you have in mind it will be possible to produce formulas of the form P\colon \ (x,y,z)\mapsto (x',y',z')^T:=A{\bf x} + {\bf b}\ , where $A$ is a certain matrix operating on the column vector ${\bf x}=(x,y,z)^T$, and ${\bf b}$ is a constant vector. If your projection is not a parallel projection but a "perspective" the corresponding formulas will be more complicated.

For the reasons mentioned above it is not possible to obtain $P({\bf x})$, given {\bf x}'. It is true that by applying $P$ also some information about ${\bf x}$ is lost, but it is different from the information lost in applying the orthogonal projection $P_y$ onto the "world plane" $y=0$.