## Transform 2D point to 3D Space

### Transform 2D point to 3D Space

Hi

This might be a simple question for some of you. I haven't done this
for years so I don't remember how you do it.

I am given a 2D point on a plane (say dx and dy). I am given also the
directional cosines for that plane, the position of the lower right
corner of that plane, plus the column and row lenght of the plane.

My problem is now trying to map the 2D point, into a 3D point in the
coordinate system where the plane resides.

Can anyone give me some points on how I should do this?

### Transform 2D point to 3D Space

> I am given a 2D point on a plane (say dx and dy). I am given also the
> directional cosines for that plane, the position of the lower right
> corner of that plane, plus the column and row lenght of the plane.

Fine, except that "planes" don't have any such thing as a "lower right
corner" --- they're infinite in all directions.

Quote:> My problem is now trying to map the 2D point, into a 3D point in the
> coordinate system where the plane resides.

You'll need a parametric equation of your plane, like this:

Point3D(dx,dy) = Point3D(0,0) + dx * Vector3D("row")
+ dy * Vector3D("column")

Point3D(0,0) is your "lower right corner" point.

The two 3d vectors, however, can't be constructed from the input you
have.  You're lacking one piece of input.  The only thing you know is
that their cross product must be parallel to the 3D vector built by
your directional cosines, otherwise known as the "plane normal", and
they must be orthogonal to each other.  But that leaves rotation of
the whole "plane" around that normal vector unspecified.
--

Even if all the snow were burnt, ashes would remain.

Hi

I'm a newbie to all this, so I hoping someone can point in the right
direction. I have a rectangular region (R) that lies in a 3D
coordinate system.

I have the location of the upper left hand corner of R, point
P(a,b,c).
I also have six directional cosines. One set of three (dcx1,dcy1,dcy1)
pertain to one vector V1, that originates from P.  The other set of
three (dcx2, dcy2, dcz2) pertain to the vector V2, that orignates from
P and is perpendicular to V1.  V1 and V2 from the boundaries of one
corner of the region R.

V1
P-----------------|
|         X       |
V2 |                 |
|-----------------|

Given a 2D point X (x1,x2) in the local space of the region R, I want
to determine its location in the 3D global space.

I came up with the following

M =   |dcx1, dcx2,0,a  |
|dcy1, dcy2,0,b  |
|dcz1, dcz2,0,c  |

3DPoint = M * [x1,x2,0,1]

Is this correct?

Also how what would I have to do to go the other way?  That is, given
a 3D point that I know is on R, I have to determine a 2D point in the
space of the region.

Thanks!

6. Mac LW