[Math] How to convert 2D coordinates to 3D coordinates

3dcoordinate systemsgeometry

I am writing some software for image processing where a user can just draw something (e.g. a cube) in paint and the software will give you the 3d coordinates of the corners on that drawing. What would be an easy mathematical formula to convert the 2D coordinates from the image to real world 3D coordinates?

Best Answer

If it is a prismatic object you want then you can extrude or drag the shape in the third 3D space direction. Word,Excel and many softwares can readily show such images of blocks.

To formulate a surface if co-ordinates are given in parametric form $ x(t), y(t) $ forming any base contour, then add $ z = c u $, where $c$ is chosen for the depth you want.

$$ (x(t), y(t), c u ); $$

In general conversion of 2D projection to 3D as you ask is indeterminate. However, if two orthogonal views are given, then using certain rules softwares like Autodesk can create a 3D view that you can rotate in 3D with mouse.

For mathematical generation of a extruded or linearly swept surface:

Use two parameters $(t,u)$ one for reference plane and other for creating depth that would get you such a 3D extrusion/prism surface.

Related Question