Projective transform a series of points

29 Views Asked by At

Apologies for my lacking ability in mathematics.

My issue: I have a series of points in 2d space that are joined together to make a continuous line. My task is to skew these points. Essentially I am trying to tilt the image on a 3rd axis and display it in a 2d form.

Supporting image

Thanks.

1

There are 1 best solutions below

1
On BEST ANSWER

Take your points $(x,y)$ and embed them in 3D space by adding a third coordinate of $0$ to get $(x, y, 0)$.

Now rotate them along the X axis by some angle $\alpha$ to get $(x, y\cos\alpha, y\sin\alpha)$.

Finally, perspective project them onto the XY plane again, assuming your camera has distance $b$ from the XY plane, to get $\frac{b}{b+y\sin\alpha}(x, y\cos\alpha)$.

Choose $\alpha$ and $b$ as desired to get a nice perspective.