Drawing with postscript III, 15th of May 2013.

Durer; explanation of perspective

The third part of the introduction to postscript is more general than postscript. It is the aim of this part to explain the elementary perspective. The perspective is something we recognize in Renaissance paintings, and Renaissance masters knew well that they discovered a "grand secret". Albrecht Dürer explains the grand secret and specifies how one should draw the scene in front of him. In short, the one who draws should position his eye next to some fixed object and the scene should be viewed through the "perspective window", the frame divided in smaller squares by using e.g. a stretched thread so that it forms some sort of a coordinate system. The same coordinate system is on the paper which the observer uses to draw on it (the image above).

When the observer observes the perspective window, he sees a two-dimensional coordinates of all of the points in the scene and he transfers them to the coordinate system indicated on the paper. In this way, the person who draws transforms the scene coordinates (x,y,z) (blue circles in the image above) to the two-dimensional coordinates of the perspective window i.e. paper (x', y') (yellow circles in the image above). The perspective transformation will depend on the distance of the observer from the perspective window, denoted by d on the image above.

durer; drawing perspective with the help of a thread

The whole procedure of drawing in perspective could be to some extent "automatized" as is shown in the image above where one observes the making of the perspective transformation using a thread which physically represents the optical ray, which was fixed with the help of a weight in the position of an "eye". Of course, the whole process was quite boring, and also tiring.

In context of computer graphics it is enough to note that this type of perspective transformation can be precisely mathematically encoded, using only triangle similarity arguments. The equations of the perspective transformation (x,y,z; d) -> (x', y') are shown in the image below:

x' = x d / (z + d)

y' = y d / (z + d)

durer; the equations of perspective transformation

These transformations enable one to use postscript or any other "2D" application to draw three-dimensional objects.

The perspective depends on the distance of the observer from the scene, d. The image below shows fullerenes drawn in postscript for different parameters d. When d becomes much larger than the characteristic dimensions of the object (the observer is very far away), then the perspective becomes orthographic. For such a transformation x'=x, y'=y, i.e. it does not depend on the z-coordinates (depth) of the points.

On the image one can see how for small distances of the observer from the object (perspective window), the nearer parts of the fullerene surface (red) appear much larger than those which are farther away, from the other side of the fullerene - compare the sizes of the closest and farthest pentagon. As the observer moves away from the scene, the sizes of the closest and farthest pentagon become more alike. One should also observe that the whole image is smaller for smaller values of parameter d, and it grows as d increases. In the representations of fullerenes this effect was compensated for, so that all the perspective images in 2D are of about the same radii.

fullerene perspective

To conclude: the perspective transformations described above can be used to get a set of transformed coordinates (x',y') from a set of full 3D coordinates (x,y,z). To the set of 2D coordinates one can then apply the techniques of drawing in postscript which I described in >> first and >> second part of the introduction to postscript.

<< Drawing with postscript II Introduction to scientific visualization 1 >>

Last updated on 18th of May 2013.