This article has since been revised and updated[size="5"]Abstract This paper discusses how axonometric projections may be used in computer graphics, multimedia applications and computer games. It compares the axonometric projection, or parallel perspective, to the linear perspective, lists the major properties and tackles some implementation details. The focus of this paper is on the isometric and dimetric projections, the most widely used varieties of the axonometric projection. This paper also presents two dimetric projections that are suitable for (tiled) computer graphics. [size="5"]Introduction -- first attempt In the Western world, we are accustomed to the linear perspective, which tries to achieve visual realism in paintings of 3-dimensional environments. The linear perspective, which was perfected throughout the 17th century in Europe, is based on Euclidean optics: the eye as a point object that catches straight light rays and that senses only the colour, the intensity and the angle of the rays, not their length. Another perspective had developed in oriental art: the "Chinese perspective" was an intrinsic part of the classical scroll painting (actually, "Chinese perspective" is a bit of a misnomer because the same perspective was also used in Japanese art and that of other oriental countries). A typical Chinese scroll painting had a size of approximately 40 centimetres high by several meters wide. One views the painting was viewed by unrolling it (from right to left) on a table in segments of about 60 centimetres wide. The Chinese scroll paintings show a development in time --a form of "narrative art", in contrast to the paintings that were made in Europe at the time, which show a "situation" rather than a development. For these scroll paintings, the Chinese painters needed a perspective that had no explicit vanishing points; every scene of the scroll painting would be seen individually and a vanishing point that lies outside the viewport creates a disoriented view of the scene. (For the same reason, the Chinese scroll paintings usually do not have an explicit light source or cast shadows.) The Chinese painters solved the problem by drawing the lines along the z-axis as parallel lines in the scroll painting. This has the effect of placing the horizon at an imaginary line, infinitely high above the painting. The axonometric projection is a technical term for a class of perspectives to which the Chinese parallel perspective also belongs. These perspectives are not only lacking a vanishing point, they also have a few other, mostly useful, characteristics. These are discussed below. [size="5"]Introduction -- second attempt Technical drawings need to be precise, accurate and unambiguous. Technical drawings are for engineers and fitters. National institutes formally standardize technical drawings, so that a carpenter will build the particular chair that the furniture designer imagined. Technical drawings are a means of communication, for those who can understand it. If the world were populated by engineers, nothing else would matter -- but it isn't and engineers (and fitters and carpenters alike) need to communicate with managers and customers. The problem is, of course, that technical drawings are difficult to decipher for the uninitiated. Although they show an object from up to six angles, all of those angles are unrealistic: directly from the front, directly from above, etc. What is needed to convey the general shape of the object is a perspective drawing that shows three sides of a cube at once. At this point, the next issue is: how? Engineers being as they are, they want a simple technique that does not loose much of the accuracy of the original drawings and that does not require artistic skills. Also note that in most cases the object that you must draw does not yet exist, so usually you cannot take a look at the object to get a sense for its proportions. That makes it nearly undoable to adequately position the vanishing points and to estimate the foreshortening. The compromise, that became to be known as axonometry, is a drawing technique where the orthogonal x-, y- and z-axes of the (3-dimensional) world space are projected to (non-orthogonal) axes on paper. In the projection, the y-axis usually remains the vertical axis, the z-axis is skewed and the x-axis may either be horizontal, as in the figure at the right, or be skewed as well. A more important property of axonometry is its fixed relation between sizes of objects in world space and those on projected space, independent of the positions of the objects in projected space. In linear perspective, objects become smaller when they move farther away; not so in axonometric perspective. This means that you can measure the size of an object of a axonometric drawing and know how big the real object is (you need to know the scale of the drawing and the properties of the projection, but nothing else), something that cannot be done with linear perspective. This leads to the name of the projection: the word "axonometry" means "measurable from the axes". Although there are countless possible axonometric projections, only two are standardized for technical drawings. These are described in detail below. [size="5"]Introduction -- third attempt Computer games have traditionally been brimming with graphics and animation. In fact, games are categorized according to the kind of graphics they used. Two popular types of games are "platform games" where you look from the side, and "board games" where you look mostly from above. These games also have in common that they often use tiles to build the "world" from. Given these similarities, and given the dullness of the unrealistic viewpoints of both platform games and board games, the attempt to make a compromise between these extreme viewpoints is a logical next step. So what one does is take a board of a board game, scale its height (the z-axis) and skew it so that the z-axis on the computer display is a diagonal line. For a better appearance, you can also skew the x-axis. The y-axis remains vertical. This is all that is needed, provided that you get the proportions (for scaling and skewing) right. Due to the coarseness of digital coordinates and the requirement that the edges of (checkerboard) tiles should match precisely, without any pixel overlaps or gaps, the skewing angles and scaling factors that game designers use are an approximation of the visually optimal proportions. One of the simplifications that game designers have made is to use an axonometric projection where a unit along an axis is equally long for all of the three axes. That is, every axis has the same metric; hence, the projection is named "isometric". Axonometric projections and tile-based images are not necessarily related. But most computer games that use an isometric perspective also use tile-based images. [size="5"]And now for something completely different... The three questions that occupied me when planning this paper were:
- What are common (or well-proportioned) axonometric projections, and how persuasive does each look?
- At what angles does one look at board in an axonometric projection? It is tempting to use rendered 3-D objects on an axonometric map, as sprites. To specify the position and orientation of the "camera" in relation to the object, you will need to know the intrinsic angles of the axonometric map that you are using.
- What does one write in an introduction anyway?
- No vanishing points. This allows you to scroll a large image below a viewport and to have the same perspective at any point. In the case of tile-based images, an image is constructed on the fly and need not to have physical bounds or edges.
- Lines that are parallel in the 3-dimensional space remain parallel in the 2-dimensional picture. This is in contrast with the linear perspective, where parallel lines along the z-axis in the 3-dimensional space collapse to a single vanishing point at the horizon in the 2-dimensional picture.
- Objects that are distant have the same size as objects that are close; objects do not get smaller as they move away from the viewer. If you know the scale of the axes, you can measure the size (width, height, length, depth) of an object directly from the picture, regardless of its position on the z-axis; hence the name axonometry.
- The axonometric projections are standardized for technical drawings. These standards are optimized for ease of use versus visual realism. Even if you choose to deviate from the standards, use them as an inspiration. The two projections standardized by the Dutch standardization institute are presented in this paper.
"A City of Cathay" -- an 11-meter handscroll by artists of the Qing court
I can give only a rough estimate of the scaling of the z-axis in this scroll painting ("a City of Cathay"): between 0.6 and 0.7 (but probably closer to 0.6). [size="5"]Dimetric projections for computer graphics and games As was the case with the isometric projection, in computer graphics some angles are preferable to others. The first dimetric projection that I propose for (tiled) computer graphics is very similar to the projection of Chinese scroll paintings. The difference is the scale of the z-axis, and the angle that it makes with the x-axis. To start with the angle, the z-axis is slanted with approximately 27 degrees (the exact angle is "arctangent(0.5)"). This is the same angle as the isometric projection for computer graphics uses. The scale is such that the width of the side view of a cube, when measured along the x-axis, is half of the width of the front face. The key phrase in the previous sentence is "when measured along the x-axis". In the two former projections, the scale factor applied to distances measured along the z-axis.Dimetric 1:2 projection "side-view"
The above projection gives a perspective that is viewed mostly from the side. I might be useful to add some depth to a side-scrolling (or "platform") game. For board-like games, a perspective that is viewed from a greater height is more appropriate. The second proposed dimetric projection for games serves this end.Dimetric 1:2 projection "top-view"
Again, note that the perspective of the two projections suggested above is distorted. The angles in the top and side views are really approximate. For example, in the second projection the angle at which one looks from above at the scene is given as 24 degrees. However, using an angle of 30 degrees may actually look better. In addition, a 30-degree angle lets you use the same objects for both the dimetric and the isometric projections for games. Other dimetric projections are summarized in the table below. These projections were taken from the [alink='ref']CARTESIO[/alink] program. For each projection, I give the name that the program gives to the projection, the slant for the x- and z-axes and the scale for the z-axis. In all the projections presented here, the the y-axis remains vertical and the x- and y-axes have the same scale. projection namex-axis anglez-axis anglez-axis scale130, 130, 10010400.591, 1, 2/312.838.60.6671, 1, 3/416.336.80.75The CARTESIO program lists more projections than the few above, including those of the NEN 2536 standard and a few ones that are so distorted that I see no practical use for them. [size="5"]Moving across an axonometric projection Converting from space coordinates (x,y,z) to a pixel coordinate (x',y') in the projection requires only trivial geometry. The table below presents the formulae for completeness (also refer to the coordinate system in the figure near the top of this paper for my definition of the x-, y- and z-axes). Isometric[alink='ref']NEN 2536[/alink]x' = (x - z)?cos(30?) y' = y + (x + z)?sin(30?)Computer gamesx' = x - z y' = y + 1/2 (x + z)Dimetric[alink='ref']NEN 2536[/alink]x' = x?cos(7?) + 1/2 z?cos(42?) y' = y + 1/2 z?sin(42?) - x?sin(7?)Chinese scroll paintingsx' = x + n?z?cos(T) y' = y + n?z?sin(T) where n is 0.5 to 0.7 and T is 30? to 40?Computer games: side viewx' = x + 1/2 z y' = y + 1/4 zComputer games: top viewx' = x + 1/4 z y' = y + 1/2 zConverting coordinates in the projection to space coordinates is a different matter. In its general form, it simply cannot be done: you cannot calculate three independent output parameters from two input parameters. If you can "fix" one of the output parameters, the other two can be calculated from the input parameters. An example: if the axonometric projection represents a map and you can assume that the area on the map has little or no relief, then you can fix the position on the y-axis to zero (ground level), and you only have to calculate x and z from x' and y'. A refinement of the above is to support some amount of relief. The calculation of the output coordinates starts as before, only now the y-coordinate is an estimate, rather than a "known" value. After calculating the x- and z-coordinates, you can look up the corresponding "height" value at the position (x,z). Typically, they will not match with the y-coordinate that you guessed when calculating the x- and z-coordinates. Now you can adjust you estimate of the y-coordinate and calculate the matching x- and z-coordinates again. This iteration continues until the estimated y-coordinate (before calculating x and z) comes close enough to the looked-up value (after calculating x and z). The principal question in following this iterative procedure is: "does it converge?" Following intuition, the procedure is considered to converge if no spot on the project surface obscures another location in 3D space. That is, if the slopes of the surface relief stays below the viewing angle (in the "view direction"), every location on the map in 3D space has a unique "sibling" location in the axonometric projection, which is visible from the view point. In the above image, the viewing angle from the horizontal plane is 30 degrees and the steepest slope in the view direction is approximately half of that. If you have extreme relief, or overlapping "ground levels" such as bridges or buildings, I suggest that you separate the projected map into parts that, themselves, adhere to the limitation of no steeper angles than the viewing angle. These parts can be separate "layers" or "sprites" and you build the full map by combining them. To calculate (x,y,z) from (x',y') you first decide on what layer/sprite the location (x',y') is and then use the iterative procedure to find the values of x, y and z. [size="5"] [aname=ref]Further information Foley, James D. [et al.]; "Computer Graphics: Principles and Practice"; Addison-Wesley; second edition, 1990; ISBN 0-201-121107. [bquote]This encyclopedic book covers perspective projections in chapter five.[/bquote] Krikke, J.; "Axonometry: A Matter of Perspective"; IEEE Computer Graphics and Applications; July/August 2000. [bquote]A (historic) overview of axonometric projections from the viewpoints of oriental art, technical drawings and computer games --in the same spirit as the three introductions to this paper, but in a more detailed and coherent article. [nbsp][nbsp]The article argues that the word "axonometry" should refer only to the particular projection used by oriental artists (the so-called "Chinese perspective") whereas the generic term is "orthographic projections". Citing NEN 2536 and Foley [et al.] as a reference, I treat axonometric projections and parallel projections as synonyms, while an orthographic projection is one where the viewing direction is perpendicular to a plane, showing no perspective at all.[/bquote] NEN 2536; "Engineering drawing. Axonometric projection"; Nederlands Normalisatie Instituut; August 1966. [bquote]A Dutch standard for axonometric projections for technical drawings. [/bquote]The IsometriX homepage. [bquote]This site contains a lot of links to pages with background information on isometric projections, games using isometric projections, some source code, etc. [/bquote]Trevisan, Camillo; the CARTESIO program; version 3.03e. [bquote]An educational and interactive application that features many geometric projections. It is free for personnal use. [/bquote] (C) Thiadmer Riemersma, ITB CompuPhase, 1999-2001, The Netherlands http://www.compuphase.com