I'm basically trying to emulate Photoshop's Vanishing Point tool where you can define the 4 2D points and the 3D plane is calculated from that information, in terms of the rotation of the plane relative to x y and z axes.

So if you have an image like this one:



And you define the points of the four corners, maybe like this:



it would define the 3D plane that the surface must live on relative to the x y and z axes.

Researching this has led me to some tutorials on drawTriangles and Homographies, but they all seem to be focused on mapping bitmap data and I can't seem to find anything that defines a 3D plane itself.

Anyone have any experience with such a problem? Any pointers would be great appreciated.