Apply projective transformation on plane in 3D
<p><strong>Scenario</strong><br />
I have a 3D environment which contains a 3D scene and a '2D' scene.
The 3D scene contains a cube and a perspective camera.
The '2D' scene contains 4 round objects and an orthographic camera. These round objects can be moved around by the user therefor the orthographic camera is used otherwise the round objects can be moved 'in depth' (along z-axis) and could change in size and i want them to maintain size.<br />
Depending on positioning the round objects, the corners of the cube in the 3D scene should be aligned with the positions of the round objects. And maintaining perspective.<br />
<em>Edit:</em> <br />
What i am trying to accomplish is: Based on an image of a room a user uses those round objects to define the dimensions of the room. Based on those dimensions a hidden cube is positioned to act as a boundery box. The next step would be to add 3d objects to the scene and maintaining perspective of the room.<br />
I tried explaining this scenario in a picture:<br />
<a href="https://i.stack.imgur.com/bCAqb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bCAqb.png" alt="situation sketch"></a><br /><br />
<strong>Problems</strong><br />
Basically i have no clue where to start.<br />
The round objects are in a '2D' environment because of the orthographic camera, therefor i have no depth value that i think i need.
I think i need some perspective transformation based on camera positions/settings? There are all sorts of matrices that could be produced but don't know how to implement them.<br /><br />
<strong>Sources i studied</strong><br />
<a href="http://www.graphicsmill.com/docs/gm/affine-and-projective-transformations.htm" rel="nofollow noreferrer">http://www.graphicsmill.com/docs/gm/affine-and-projective-transformations.htm</a><br />
<em>below is a similar situation</em><br />
<a href="https://math.stackexchange.com/questions/296794/finding-the-transform-matrix-from-4-projected-points-with-javascript">https://math.stackexchange.com/questions/296794/finding-the-transform-matrix-from-4-projected-points-with-javascript</a><br />
<em>Cannot post more links because of my reputation</em><br /><br />
I hope someone can make this clear or point me in the right direction</p>