Are there any mathematical equations or a math procedure by which you can define a perspective drawing?

438 Views Asked by At

I have seen so many mathematical procedures including matrix. But all don't seem to plot a perspective view. Why is it hard to establish simple vector equations by which you can input the true x,y,z coordinates of any point in the object and output X,Y coordinates of the corresponding point in perspective projection? Keep in mind that the perspective view is such as a photo taken by a camera. Hence, the location of the camera with respect to the object as well as the tilt angle of the camera (as per bird's and worm's eye views) can give different perspective views. Does anyone have any mathematical approach to execute such a process? Coordinates of the plan a(-0.38, 1.86). b(0.18, 1.65) c(0.38, 2.21). d(-0.18, 2.41) The height of the cube is (0.61) Please, show me how you get the coordinates of eight points of the perspective drawing. Thanks!

plan of a cube

perspective of a cube

2

There are 2 best solutions below

2
On

Imagine a central projection, with $(0,0,0)$ as the center and $z=1$ as the image plane. Then you draw a 3D point $(x,y,z)$ at position $(x/z,y/z)$. That's the core idea behind homogeneous coordinates: any point in the direction $(x,y,1)$, i.e. any multiple thereof, represents the point $(x,y)$.

If your camera or your image plane is somewhere else, you'd usually first apply a transformation to reduce that to the situation just described. If you want to include translations in 3d space, you would input homogeneous 3d points, i.e. vectors with four elements, so the whole projection would be a $3\times4$ matrix converting homogeneous input to homogeneous output coordinates.

4
On

Since you are not so fussy i'm resolving the ambiguities to the point where we have concrete 'simple vector equations' such as $x=PX$, to produce the $8$ coordinates of the perspective drawing.
As $3$D points let's choose: $$AT = (-0.380, +1.860, +0.305)^t\\ BT = (+0.180, +1.650, +0.305)^t\\ CT = (+0.380, +2.210, +0.305)^t\\ DT = (-0.180, +2.410, +0.305)^t\\$$ for the top and enter image description here $$AB = (-0.380, +1.860, -0.305)^t\\ BB = (+0.180, +1.650, -0.305)^t\\ CB = (+0.380, +2.210, -0.305)^t\\ DB = (-0.180, +2.410, -0.305)^t\\$$ for the bottom.

For the $2$D projections i manually extracted them from the perspective drawing showing the $8$ points. These are given in so called pixel coordinates. Since your image has the size width$~=144$ and height$~=178$, they don't exceed those values. Please don't use .jpg for line drawings: use .png$$ at = (021.45, 041.01)^t\\ bt = (106.13, 047.19)^t\\ ct = (124.18, 034.18)^t\\ dt = (056.27, 030.27)^t\\$$ for the top and $$ ab = (021.02, 130.82)^t\\ bb = (106.56, 148.07)^t\\ cb = (124.18, 110.32)^t\\ db = (056.27, 099.91)^t\\$$for the bottom.

Now we follow the procedure from here for a way to fit a projection matrix $P$ to $2$D and $3$D point correspondences.enter image description here

Blue circles $at, bt, \ldots$, magenta stars: projections of $AT, BT, \ldots$ $$P=\begin{pmatrix} 136.11 & -01.54 & +000.00 & 080.14\\ 001.42 & -42.17 & -137.89 & 165.94\\ 000.00 & +00.00 & +000.00 & 001.00 \end{pmatrix}$$