Jump to content
  • Advertisement
pamparana

orthogonal projection of 2D point to a 3D plane

Recommended Posts

I found some guides on how to project a 3D point to a 3D plane. (https://stackoverflow.com/questions/8942950/how-do-i-find-the-orthogonal-projection-of-a-point-onto-a-plane)

However, I wonder if it is possible to do an orthogonal projection of a 2D point onto a 3D plane (defined either by a normal and a point or as a 4D vector normal form)?

The context is that I have fitted a 3D plane to an image scene and then I want to do an orthogonal projection of a 2D image pixel coordinates onto this plane.

Share this post


Link to post
Share on other sites
Advertisement

Sure you can, it's simple vector math in fact, as long as you're talking rectangles.

Imagine a 2D image, define one corner as (0, 0), and the opposite corner as (xlen, ylen).

Imagine a plane, and define the position on the plane where (0, 0) is going to be as p0, the position on the plane where (xlen, 0) is going to be as px, and the position where (0, ylen) is going to be as py.

Now, a point (x, y). The x component is going to be (px-p0)*x/xlen away from p0 along the edge (0, 0) to (xlen, 0), on the plane. The y component is (py-p0)*y/ylen in a similar way. The end position on the plane is the sum of p0 and both offsets, ie p0 + (px-p0)*x/xlen + (py-p0)*y/ylen. It works because everything is linear.

The simplest way to see it is by having a 'flat' plane, with a constant z. That avoids complicated 3d computations, and your 3d plane can be a simple sheet of paper on a table where you can easily draw the vectors.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!