3d orthogonal projection on a plane

3dgeometrymathprojection

I have a point in 3d P(x,y,z) and a plane of view Ax+By+Cz+d=0 . A point in plane is E.Now i want to project that 3d point to that plane and get 2d coordinates of the projected point relative to the point E.

P(x,y,z) = 3d point which i want to project on the plane.
Plane Ax + By + Cz  + d  = 0 , so normal n = (A,B,C)
E(ex,ey,ez) = A point in plane ( eye pos of camera )

What i am doing right now is to get nearest point in plane from point P.then i subtract that point to E.I suspect that this is right ???

please help me.Thanks.

Best Answer

The closest point is along the normal to the plane. So define a point Q that is offset from P along that normal.

Q = P - n*t

Then solve for t that puts Q in the plane:

dot(Q,n) + d = 0
dot(P-n*t,n) + d = 0
dot(P,n) - t*dot(n,n) = -d
t = (dot(P,n)+d)/dot(n,n)

Where dot((x1,y1,z1),(x2,y2,z2)) = x1*x2 + y1*y2 + z1*z2

Related Topic