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 :)

  • 0
    There are some points in your question that are still not clear. First of all, I want to make sure that your world point belongs to the world plane. Second, what you want to do is project that 3D point into the second plane, that does not contain the world point, right? If that is so, then there is not a unique way to do it. You have to define a projection mapping. You could project the point perpendicularly into the plane, for example, but that is not the only way to do it.2012-02-11
  • 0
    Your question doesn't quite make sense. One usually speaks of converting points between *reference frames* or *coordinate systems*, and a plane is not a coordinate system. You need two more vectors that lie along the plane, say $u$ and $v$, before you can meaningfully talk about converting a point from the world coordinate system, relative to the $x$, $y$, and $z$ axes, to the local coordinate system, relative to $u$, $v$, and $n$.2012-02-11
  • 0
    I just saw Manolito's comment that has a very different interpretation of your question than mine. Maybe you should post an example of what you are trying to achieve with this procedure, so that there is no confusion.2012-02-11
  • 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