<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE page SYSTEM "gen/gandraxa.dtd">
<?xml-stylesheet type="text/xsl" href="gen/gandraxa.xsl"?>
<!--
	To see this page properly, install a browser capable of
	interpreting XML/XSL, for example a recent version of:
	- Mozilla Firefox, see http://www.mozilla.com/
	- Google Chrome, see www.google.com/
	- Internet Explorer, see http://www.microsoft.com/
-->
<page>
	<head>
		<title>Isometric Projection</title>
		<url>http://www.gandraxa.com/isometric_projection.xml</url>
		<menuimg>
			<img>
				<url>img/imp_menu.jpg</url>
				<alt>Isometric projection</alt>
			</img>
		</menuimg>
		
		<context>
			<path>
				<home>
					<link loc="int">
						<url>home.xml</url>
						<text>Home</text>
					</link>
				</home>
				<dir>
					<link loc="int">
						<url>articles.xml</url>
						<text>Articles</text>
					</link>
				</dir>
				<dir>
					<link loc="int">
						<url>digital_terrain_analysis.xml</url>
						<text>Digital Terrain Analysis</text>
					</link>
				</dir>
				<doc>Isometric Projection</doc>
			</path>
			
			<chain>
				<prev>
					<link loc="left">
						<url>digital_elevation_models.xml</url>
						<text>Digital Elevation Models</text>
					</link>
				</prev>
				<next>
					<link loc="right">
						<url>isometric_tiling.xml</url>
						<text>Isometric Tiling</text>
					</link>
				</next>
			</chain>
		</context>
		
		<author>
			<mail>
				<recipient>hg</recipient>
				<server>gandraxa.com</server>
				<name>Herbert Glarner</name>
			</mail>
		</author>
		
		<publ>
			<event>
				<eventdate><y>2007</y><m>Mar</m><d>19</d></eventdate>
				<eventtext>
Original HTML version</eventtext>
			</event>
			<event>
				<eventdate><y>2011</y><m>Jan</m><d>24</d></eventdate>
				<eventtext>
					Recoded in XLM
				</eventtext>
			</event>
		</publ>
		
		<furtherreading>
			<readitem>
				<link loc="wiki">
					<url>http://en.wikipedia.org/wiki/Isometric_projection</url>
					<text>Isometric Projection</text>
				</link> 
on Wikipedia
			</readitem>
			<readitem>
				<link loc="ext">
					<url>http://www.gamedev.net/reference/articles/article1269.asp</url>
					<text>Axonometric Projections</text>
				</link> :
				a Technical Overview
 by Thiadmer Riemersma
			</readitem>
			<readitem>
				<link loc="ext">
					<url>http://www.gamedev.net/reference/list.asp?categoryid=44</url>
					<text>Articles about isometric projections</text>
 
				</link>
 on GameDev.net
			</readitem>
		</furtherreading>

		<books>
			<book>
				<img>
					<url>https://images-na.ssl-images-amazon.com/images/I/51kARSbz6fL._SL75_.jpg</url>
					<alt>Technical Graphics</alt>
				</img>
				<booktitle>Technical Graphics (Paperback).</booktitle>
				<booklinks>
					<booklink-us>http://www.amazon.com/gp/product/1585033952/ref=as_li_qf_sp_asin_tl?ie=UTF8&amp;tag=gandraxa0d-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1585033952</booklink-us>
					<booklink-ca>http://www.amazon.ca/gp/product/1585033952/ref=as_li_qf_sp_asin_tl?ie=UTF8&amp;tag=gandraxa02-20&amp;linkCode=as2&amp;camp=15121&amp;creative=330641&amp;creativeASIN=1585033952</booklink-ca>
					<booklink-uk>http://www.amazon.co.uk/gp/product/1585033952/ref=as_li_qf_sp_asin_tl?ie=UTF8&amp;tag=gandraxa-21&amp;linkCode=as2&amp;camp=1634&amp;creative=6738&amp;creativeASIN=1585033952</booklink-uk>
				</booklinks>
			</book>
		</books>
	</head>

	<toc>
		<toc1 ref="A">Introduction</toc1>
			<toc2 ref="A1">Isometric Projection</toc2>
			<toc2 ref="A2">Dimetric Projection</toc2>
		<toc1 ref="B">Surfaces</toc1>
			<toc2 ref="B1">Applying Isometry</toc2>
			<toc2 ref="B2">Spotlight on Tiles</toc2>
			<toc2 ref="B3">Irregular Tile Properties</toc2>
			<toc2 ref="B4">Deriving the Coordinates</toc2>
			<toc2 ref="B5">Generalizing the Coordinates</toc2>
			<toc2 ref="B6">Examples</toc2>
		<toc1 ref="C">Rendering Flat Surfaces</toc1>
			<toc2 ref="C1">Screen Center and World Focus</toc2>
			<toc2 ref="C2">Translating World to Screen</toc2>
			<toc2 ref="C3">Redefining the Focus</toc2>
			<toc2 ref="C4">Redefining the Center</toc2>
		<toc1 ref="D">Working with Elevations</toc1>
			<toc2 ref="D1">Number of Elevation Points</toc2>
			<toc2 ref="D2">Elevation Base</toc2>
			<toc2 ref="D3">Revisiting the Formulae</toc2>
			<toc2 ref="D4">Averaged Center Elevation</toc2>
			<toc2 ref="D5">The Final Formulae</toc2>
	</toc>

	<abstract>
		<p><ptitle>Abstract</ptitle>
			This page provides the theoretical and technical background of projecting 
			obtained elevation data isometrically.</p>
	</abstract>



	<part>
		<heading id="A">Introduction</heading>
		<chapter>
			<heading id="A1">Isometric Projection</heading>
			<body>
				<img float="left" width="125">
					<url>/img/imp_fig01.jpg</url>
					<alt>An isometric cube</alt>
					<caption>Fig. 1: An isometric cube</caption></img>
				<p>An isometric projection is defined by the property, 
					that all the axes have the same metric 
					(isometric, Greek: "equal measure"). 
					Let's draw a cube to visualize what this means (fig. 1).</p>
				<p>All the cube's edges have the same length. 
					Furthermore, because the angles between sides all are 
					<formula>120°</formula>, 
					all sides are symmetric 
					<link loc="wiki">
						<url>http://en.wikipedia.org/wiki/Rhombus</url>
						<text>rhombi</text>
					</link>, 
					meaning that the surface of each side is equal. 
					Also note, that the perimeter of the shown cube is a perfect 
					<link loc="wiki">
						<url>http://en.wikipedia.org/wiki/Hexagon</url>
						<text>hexagon</text>
					</link>.</p>
				<p>It is easy to see, that the angles at the other side of the edges measure 
					<formula>180°-120°=60°</formula>. 
					Also, such an angle plus <formula>a</formula> make a right angle, 
					<formula>a=90°-60°=30°</formula>.</p>
				<p>But the angle <formula>a</formula> also is defined by 
					<formula>a=arctan(h/w)=30°</formula> 
					(or, more accurately, to reflect the involved triangle, by
					<formula>a=arctan((h/2)/(w/2))=30°</formula>).</p>
				<p>For the relationship between <formula>h</formula> and 
					<formula>w</formula> therefore must be true, that
					<formula>h/w=sin(30°)/cos(30°)=tan(30°)=0.57735</formula>, 
					or probably more conveniently, <formula>h/w=1/sqrt(3)</formula>.</p>
			</body>
		</chapter>
		<chapter>
			<heading id="A2">Dimetric Projection</heading>
			<body>
				<img float="left" width="114">
					<url>/img/imp_fig02.jpg</url>
					<alt>A magnified 30° line</alt>
					<caption>Fig. 2: A magnified 30° line</caption></img>
				<p>However, in computer graphics this real isometry is not truely liked. 
					The reason for this becomes apparent, when we magnify 
					one of the surface edges in the x/z-plane (fig. 2):
					The lines just don't look good.</p>
				<p>30°-lines appear blocky and unsmooth. 
					Mainly for this reason, it is usual in computer graphics 
					to not use real isometric projections and apply lines 
					which truely look straight instead (fig. 3), 
					even if that means to depart from the nice 30°, 60° and 120° angles.</p>

				<floatclear/>
				<img float="left" width="114">
					<url>/img/imp_fig03.jpg</url>
					<alt>A magnified straight line</alt>
					<caption>Fig. 3: A magnified straight line</caption></img>
				<p>This line grows twice as fast horizontally than it does vertically. 
					Therefore its angle <formula>a</formula> can be determined by 
					<formula>a=arctan(1/2)=26.565°</formula>.</p>
				<p>Because of this, our <formula>120°</formula> angles of 
					the original cube need to be adjusted as well. 
					They become <formula>90°+26.565°=116.565°</formula> 
					and <formula>360°-2<ent>times</ent>26.565°=126.87°</formula> (fig. 4).</p>

				<floatclear/>
				<img float="left" width="111">
					<url>/img/imp_fig04.jpg</url>
					<alt>An optically more appealing cube</alt>
					<caption>Fig. 4: An optically more appealing cube</caption></img>
				<p>Technically, the departure from a representation with three equal 120° angles 
					makes our rendering no longer an isometric projection: 
					the accurate term for this kind of drawings is 
					<link loc="wiki">
						<url>http://en.wikipedia.org/wiki/Dimetric_projection</url>
						<text>dimetric projection</text>
					</link>. However, for convenience, we will continue to refer to the term 
					"isometric projection" in this article.</p>
				<p>Because the angles changed, <formula>h</formula> changed as well. 
					For the relationship between <formula>h</formula> and <formula>w</formula> 
					now is true, that 
					<formula>h/w=sin(26.565°)/cos(26.565°)=tan(26.565°)=0.5</formula>, 
					which is not surprising because we defined the line that way.</p>
				<p>There's another and more important reason to apply the 2:1 ratio 
					besides the one dealing with the optical appearance, though.</p>
				<p>It makes the design of structures parallel to the ground plane 
					a lot easier and oftentimes saves much time in calculating 
					the proper lengths without really affecting the optical impression too much.</p>
			</body>
		</chapter>
	</part>

	<part>
		<heading id="B">Surfaces</heading>
		<chapter>
			<heading id="B1">Applying Isometry</heading>
			<body>
				<p>Imagine a small landscape subdivided into 4<ent>times</ent>4 regular squares. 
					Let's label its rows A to D and its columns 1 to 4. 
					When we look at this small landscape of ours from above 
					it has the following appearance (fig. 5):</p>
				<img>
					<url>/img/imp_fig05.jpg</url>
					<alt>Landscape looked at from above</alt>
					<caption>Fig. 5: Landscape looked at from above</caption></img>
				<p>After applying the principles of isometric rendering as outlined above, 
					our landscape will look like this (fig. 6):</p>
				<img>
					<url>/img/imp_fig06.jpg</url>
					<alt>The same landscape in rendered isometrically</alt>
					<caption>Fig. 6: The same landscape rendered isometrically</caption></img>
			</body>
		</chapter>
		<chapter>
			<heading id="B2">Spotlight on Tiles</heading>
			<body>
				<p>This type of rendering has some issues, though. 
					They can be revealed if we look at a magnified tile. 
					Fig. 7 shows an individual tile from our landscape:</p>
				<img>
					<url>/img/imp_fig07.jpg</url>
					<alt>Magnified Tile</alt>
					<caption>Fig. 7: Magnified Tile</caption></img>
				<p>The problem becomes apparent when we attempt to connect such tiles. 
					We can not simply place them next to each other:
					it is absolutely impossible to tile them, no matter how hard we try
					(fig. 8).</p>
				<img>
					<url>/img/imp_fig08.jpg</url>
					<alt>Impossible tiling with unmatching heights and widths</alt>
					<caption>Fig. 8: Impossible tiling with unmatching 
						heights and widths</caption></img>
				<p>Notice, however, what happens when we shift the tiles 
					two pixels to the left and one pixel upwards: 
					the two adjacent edges of any two tiles are shared by each other (fig. 9).</p>
				<img>
					<url>/img/imp_fig09.jpg</url>
					<alt>Tiling made possible with shifted tiles</alt>
					<caption>Fig. 9: Tiling made possible with shifted tiles</caption></img>
				<p>Alas, it is not really possible to share an edge between different tiles: 
					even if we drew the tiles this way, it still would be true that 
					a pixel can only be displayed once 
					(although it could be drawn multiple times in the same screen location). 
					For this reason we declare, that a tile's lower edges 
					(i.e. the SW edge and the SE edge) end already with the pixel 
					just above the so far common edge (fig. 10). 
					Notice, that the green edges then do not any longer form part of our 3 tiles: 
					they indicate the top (NW and NE) edges of the next adjacent tiles.</p>
				<img>
					<url>/img/imp_fig10.jpg</url>
					<alt>Redefined lower edges</alt>
					<caption>Fig. 10: Redefined lower edges</caption></img>
				<p>That said, it is easy to see what our isometric tiles 
					eventually must look like (fig. 11): 
					whatever edge length you ultimately need to represent your grid, 
					just reduce it by a two pixel wide element and duplicate 
					the Western and Eastern corner heights.</p>
				<img>
					<url>/img/imp_fig11.jpg</url>
					<alt>Effective tile shape to allow tiling</alt>
					<caption>Fig. 11: Effective tile shape to allow tiling</caption></img>
			</body>
		</chapter>
		<chapter>
			<heading id="B3">Irregular Tile Properties</heading>
			<body>
				<p>There are a few more things to keep in mind when working with tiles.</p>
				<p>First of all, remember that the lower edges of the tiles are not treated 
					as a part of that tile any longer: although they still do exist, 
					they are rendered by the adjacent SW and SE tiles, 
					which share those edges with our tile in question. 
					Therefore, when it is desired to draw outlines as we did 
					in the initial example, then only the two upper edges should be drawn 
					(the black ones in fig. 12):</p>
				<img>
					<url>/img/imp_fig12.jpg</url>
					<alt>Outlining edges</alt>
					<caption>Fig. 12: Outlining edges</caption></img>
				<p>Secondly, since the perceived lower edges in fact are not yet 
					the real lower edges, care must be taken when the center point 
					of a tile is of importance: 
					the middle of the edge's length is not just the middle element 
					of the two pixel wide elements which we see 
					(in our example there are 6 such elements, see fig. 13), 
					but the middle element of those elements plus 1, 
					because the shared lower edge must be incuded 
					(i.e. 7 elements in our example, making the 4th the middle element). 
					Note, that the lower end points of the middle lines 
					do not fall on a 2-pixel-element of the (apparent) lower edges, 
					simply because they are not the lower edges yet.</p>
				<img>
					<url>/img/imp_fig13.jpg</url>
					<alt>Finding a tile's center</alt>
					<caption>Fig. 13: Finding a tile's center</caption></img>
			</body>
		</chapter>
		<chapter>
			<heading id="B4">Deriving the Coordinates</heading>
			<body>
				<p>Before we go one step further and seriously deal with the third dimension 
					(elevation), let's have a look at our cube again and 
					properly define the edges' coordinates for the representation 
					of its surface area:</p>
				<img>
					<url>/img/imp_fig14.jpg</url>
					<alt>The dimensions of the cube</alt>
					<caption>Fig. 14: The dimensions of the cube</caption></img>
				<p>All the edges labeled <formula>e</formula> have the same length.</p>
				<p>Now, we can let <formula>e</formula> be whatever we like: 
					1 centimeter, 1 meter or 1 mile. The important thing to remember is just, 
					that our isometric cube has equal lengths at any edge. 
					This is important, because it also says, that the effective 
					horizontal and vertical coordinates determining the edges' corners 
					are <em>not</em> equal to <formula>e</formula>. 
					In fact, the position of the edges' corners in the x/z plane 
					are calculated by foreshortening them: 
					for <formula>w</formula> is valid, 
					that <formula>w=cos(a)=cos(26.565°)=0.8944e</formula>, 
					and for <formula>h</formula> is true, 
					that <formula>h=sin(a)=sin(26.565°)=0.4472e</formula>.</p>
				<p>Notice, however, that <formula>2h=w</formula> is still valid, 
					and also notice, that the upright edge denoting the elevation 
					retains its length <formula>e</formula>: 
					no need to shorten it or to modify it in any way.</p>
				<p>Now imagine several such cubes attached to each other. 
					Let's define, that the x axis runs along the NE edges and 
					the z axis along the NW edges. 
					Labeling the "rows" with capital letters and the "columns" 
					with Roman numbers, we are able to name the individual cubes. 
					Fig. 15 shows the identifiable coordinates:</p>
				<img>
					<url>/img/imp_fig15.jpg</url>
					<alt>The coordinates of multiple cubes</alt>
					<caption>Fig. 15: The coordinates of multiple cubes</caption></img>
				<p>Still assuming an edge length of <formula>e</formula>, 
					we can now attempt to localize the 2D coordinates for our cubes, 
					i.e. the coordinates on the monitor's screen when those cubes 
					would be rendered onto a such. To avoid a terminological confusion, 
					let's refer to the screen axes simply as the horizontal and vertical 
					2D axes for now.</p>
				<p>Let's have a look at the cubes' <formula>x</formula> axis (the NE edges) first. 
					The first observation is, that the more to the right a cube is located, 
					the more increases its value on the horizontal 2D axis. 
					Specifically does the next cube to the right increase 
					its horizontal value by <formula>0.8944e</formula> (the cosine of 26.565°) 
					relative to its left neighbor. And there's a second observation to make: 
					also the vertical 2D axis is affected, even when we stay within the same row. 
					Each neighbor to the right increases 
					the vertical value by <formula>0.4472e</formula> (the sine of 26.565°) 
					relative to its left neighbor.</p>
				<p>The <formula>y</formula> axis (NW edges) is very similar in its behavior: 
					both the horizontal and vertical 2D axes change when we move one cube 
					downward. For each row we go down, the vertical 2D value increases 
					<formula>0.4472e</formula>, and simultaneously the horizontal 2D value 
					decreases by <formula>0.8944e</formula>.</p>
				<p>There's a third axis, though, which we silently ignored until now. 
					In fact, so far it is not at all an interesting axis, as it stays 
					the same all the time, namely <formula>e</formula>. 
					Still, it can be observed, that it does have an influence 
					on the coordinates which are renderened to our screen: 
					the (yellow) surface is "elevated" by <formula>e</formula>, 
					i.e. the screen's vertical axis decreases by <formula>e</formula>. 
					It does not require much imagination to see, 
					that this value influences only the vertical 2D axis: 
					the horizontal 2D axis is not affected at all.</p>
				<p>Let's try to fill in the two-dimensional screen coordinates into a table. 
					Let's refer to the screen coordinates as <formula>x<sub>Sn</sub></formula> for 
					the horizontal axis, and and <formula>y<sub>Sn</sub></formula> for 
					the vertical axis from now on (the subscript <formula>S</formula> stands 
					for <em>Screen</em>, and <formula>n</formula> simply enumerates 
					the coordinate from left to right, and top down, resp.) 
					Accordingly we will refer to the three-dimensional "world coordinates" 
					as <formula>x<sub>Wn</sub></formula> ("NE edges"), 
					<formula>z<sub>Wn</sub></formula> ("NW edges"), 
					and <formula>y<sub>Wn</sub></formula> (the elevation). 
					The subscript <formula>W</formula> stands for <em>World</em> and 
					distinguishes this set of coordinates from the 2D-coordinates.
					Be careful to not to confuse the two <formula>y</formula>-coordinates: 
					they signify different things!</p>
				<p>We recall the following observations:</p>
				<list>
					<li>
						A neighbor to the right (increasing <formula>x<sub>W</sub></formula>):
						<list>
							<li>increases <formula>x<sub>S</sub></formula> by <formula>cos(a)</formula></li>
							<li>increases <formula>y<sub>S</sub></formula> by <formula>sin(a)</formula></li>
						</list>
					</li>
					<li>
						A neighbor below (increasing <formula>z<sub>W</sub></formula>):
						<list>
							<li><em>decreases</em> <formula>x<sub>S</sub></formula> by <formula>cos(a)</formula></li>
							<li>increases <formula>y<sub>S</sub></formula> by <formula>sin(a)</formula></li>
						</list>
					</li>
					<li>
						The elevation <formula>y<sub>W</sub></formula>
						<list>
							<li><em>decreases</em> <formula>y<sub>S</sub></formula> by its true value</li>
							<li>does not affect <formula>x<sub>S</sub></formula></li>
						</list>
					</li>
				</list>
				<p>Assuming a coordinate origin of <formula>x<sub>S0</sub>=0</formula> and 
					<formula>y<sub>S0</sub>=0</formula> at an elevation of 0, 
					we can fill in the coordinates for fig. 15 into the table as follows: 
					(Hint: observe the coloring of the coefficients.)</p>
				<table>
					<row>
						<col></col>
						<col><formula>x<sub>W<redtext>0</redtext></sub></formula></col>
						<col><formula>x<sub>W<redtext>1</redtext></sub></formula></col>
						<col><formula>x<sub>W<redtext>2</redtext></sub></formula></col>
						<col><formula>x<sub>W<redtext>3</redtext></sub></formula></col>
					</row>
					<row>
						<col><formula>z<sub>W<greentext>0</greentext></sub></formula></col>
						<col>
							<formula>x<sub>S</sub>=<redtext>0</redtext><ent>times</ent>cos(a)s&#x2011;<greentext>0</greentext><ent>times</ent>cos(a)s</formula><br/>
							<formula>y<sub>S</sub>=<redtext>0</redtext><ent>times</ent>sin(a)s+<greentext>0</greentext><ent>times</ent>sin(a)s&#x2011;<bluetext>1</bluetext><ent>times</ent>s</formula>
						</col>
						<col>
							<formula>x<sub>S</sub>=<redtext>1</redtext><ent>times</ent>cos(a)s&#x2011;<greentext>0</greentext><ent>times</ent>cos(a)s</formula><br/>
							<formula>y<sub>S</sub>=<redtext>1</redtext><ent>times</ent>sin(a)s+<greentext>0</greentext><ent>times</ent>sin(a)s&#x2011;<bluetext>1</bluetext><ent>times</ent>s</formula>
						</col>
						<col>
							<formula>x<sub>S</sub>=<redtext>2</redtext><ent>times</ent>cos(a)s&#x2011;<greentext>0</greentext><ent>times</ent>cos(a)s</formula><br/>
							<formula>y<sub>S</sub>=<redtext>2</redtext><ent>times</ent>sin(a)s+<greentext>0</greentext><ent>times</ent>sin(a)s&#x2011;<bluetext>1</bluetext><ent>times</ent>s</formula>
						</col>
						<col>
							<formula>x<sub>S</sub>=<redtext>3</redtext><ent>times</ent>cos(a)s&#x2011;<greentext>0</greentext><ent>times</ent>cos(a)s</formula><br/>
							<formula>y<sub>S</sub>=<redtext>3</redtext><ent>times</ent>sin(a)s+<greentext>0</greentext><ent>times</ent>sin(a)s&#x2011;<bluetext>1</bluetext><ent>times</ent>s</formula>
						</col>
					</row>
					<row>
						<col><formula>z<sub>W<greentext>1</greentext></sub></formula></col>
						<col>
							<formula>x<sub>S</sub>=<redtext>0</redtext><ent>times</ent>cos(a)s&#x2011;<greentext>1</greentext><ent>times</ent>cos(a)s</formula><br/>
							<formula>y<sub>S</sub>=<redtext>0</redtext><ent>times</ent>sin(a)s+<greentext>1</greentext><ent>times</ent>sin(a)s&#x2011;<bluetext>1</bluetext><ent>times</ent>s</formula>
						</col>
						<col>
							<formula>x<sub>S</sub>=<redtext>1</redtext><ent>times</ent>cos(a)s&#x2011;<greentext>1</greentext><ent>times</ent>cos(a)s</formula><br/>
							<formula>y<sub>S</sub>=<redtext>1</redtext><ent>times</ent>sin(a)s+<greentext>1</greentext><ent>times</ent>sin(a)s&#x2011;<bluetext>1</bluetext><ent>times</ent>s</formula>
						</col>
						<col>
							<formula>x<sub>S</sub>=<redtext>2</redtext><ent>times</ent>cos(a)s&#x2011;<greentext>1</greentext><ent>times</ent>cos(a)s</formula><br/>
							<formula>y<sub>S</sub>=<redtext>2</redtext><ent>times</ent>sin(a)s+<greentext>1</greentext><ent>times</ent>sin(a)s&#x2011;<bluetext>1</bluetext><ent>times</ent>s</formula>
						</col>
						<emptycol/>
					</row>
					<row>
						<col><formula>z<sub>W<greentext>2</greentext></sub></formula></col>
						<col>
							<formula>x<sub>S</sub>=<redtext>0</redtext><ent>times</ent>cos(a)s&#x2011;<greentext>2</greentext><ent>times</ent>cos(a)s</formula><br/>
							<formula>y<sub>S</sub>=<redtext>0</redtext><ent>times</ent>sin(a)s+<greentext>2</greentext><ent>times</ent>sin(a)s&#x2011;<bluetext>1</bluetext><ent>times</ent>s</formula>
						</col>
						<col>
							<formula>x<sub>S</sub>=<redtext>1</redtext><ent>times</ent>cos(a)s&#x2011;<greentext>2</greentext><ent>times</ent>cos(a)s</formula><br/>
							<formula>y<sub>S</sub>=<redtext>1</redtext><ent>times</ent>sin(a)s+<greentext>2</greentext><ent>times</ent>sin(a)s&#x2011;<bluetext>1</bluetext><ent>times</ent>s</formula>
						</col>
						<emptycol cols="2"/>
					</row>
					<row>
						<col><formula>z<sub>W<greentext>3</greentext></sub></formula></col>
						<col>
							<formula>x<sub>S</sub>=<redtext>0</redtext><ent>times</ent>cos(a)s&#x2011;<greentext>3</greentext><ent>times</ent>cos(a)s</formula><br/>
							<formula>y<sub>S</sub>=<redtext>0</redtext><ent>times</ent>sin(a)s+<greentext>3</greentext><ent>times</ent>sin(a)s&#x2011;<bluetext>1</bluetext><ent>times</ent>s</formula>
						</col>
						<emptycol cols="3"/>
					</row>
				</table>
				<p>It can be seen, that the <redtext>red</redtext> coefficients repeat 
					the index of <formula>x<sub>W<redtext>n</redtext></sub></formula> and the <greentext>green</greentext> 
					coefficients the index of <formula>z<sub>W<greentext>n</greentext></sub></formula>. 
					The <bluetext>blue</bluetext> coefficients are just the elevation at that coordinate: 
					it is 1 everywhere, because our cubes all have an elevation of 1<ent>times</ent>s.</p>
			</body>
		</chapter>
		<chapter>
			<heading id="B5">Generalizing the Coordinates</heading>
			<body>
				<p>The above exercise immediately leads to a generalization on how to obtain screen formulas 
					from world coordinates:</p>
				<p><formula>x<sub>S</sub> = <redtext>x<sub>W</sub></redtext><ent>times</ent>cos(a)s - <greentext>z<sub>W</sub></greentext><ent>times</ent>cos(a)s = <highlight>(<redtext>x<sub>W</sub></redtext>-<greentext>z<sub>W</sub></greentext>)cos(a)s</highlight></formula></p>
				<p><formula>y<sub>S</sub> = <redtext>x<sub>W</sub></redtext><ent>times</ent>sin(a)s + <greentext>z<sub>W</sub></greentext><ent>times</ent>sin(a)s - <bluetext>y<sub>W</sub></bluetext><ent>times</ent>s = (<redtext>x<sub>W</sub></redtext>+<greentext>z<sub>W</sub></greentext>)sin(a)s - <bluetext>y<sub>W</sub></bluetext><ent>times</ent>s = <highlight>((<redtext>x<sub>W</sub></redtext>+<greentext>z<sub>W</sub></greentext>)sin(a)-<bluetext>y<sub>W</sub></bluetext>)s</highlight></formula></p>
			</body>
		</chapter>
		<chapter>
			<heading id="B6">Examples</heading>
			<body>
				<p>As a first example let's calculate the screen coordinates of the topmost corner 
					of the cube labeled "C0" in fig. 15. The topmost corner of C0 is 
					at world coordinates <formula><redtext>x<sub>W</sub></redtext>=0</formula> 
					and <formula><greentext>z<sub>W</sub></greentext>=2</formula>. 
					Its elevation is <formula><bluetext>y<sub>W</sub></bluetext>=1</formula> (expressed in s). 
					Let's assume, that <formula>s=1</formula> (meters, if you like).</p>
				<p><formula>x<sub>S</sub> = (<redtext>x<sub>W</sub></redtext>-<greentext>z<sub>W</sub></greentext>)cos(a)s = (<redtext>0</redtext>-<greentext>2</greentext>)<ent>times</ent>0.8944<ent>times</ent>1 = -2<ent>times</ent>0.8944<ent>times</ent>1 = <highlight>-1.7888</highlight></formula></p>
				<p><formula>y<sub>S</sub> = ((<redtext>x<sub>W</sub></redtext>+<greentext>z<sub>W</sub></greentext>)sin(a)-<bluetext>y<sub>W</sub></bluetext>)s = ((<redtext>0</redtext>+<greentext>2</greentext>)<ent>times</ent>0.4472-<bluetext>1</bluetext>)<ent>times</ent>1 = (2<ent>times</ent>0.4472-1)<ent>times</ent>1 = <highlight>-0.1056</highlight></formula></p>
				<p>Whereas the value <formula>x<sub>S</sub></formula> immediately seems to be plausible, 
					the value <formula>y<sub>S</sub></formula> might call for some additional elaboration: 
					why is the value negative, when it clearly is more South than 
					<formula>x<sub>W0</sub>, z<sub>W0</sub></formula>? 
					Well, we need to recall, that our origin is not at an elevation of <formula>1<ent>times</ent>s</formula>, 
					but at the base elevation 0. The following fig. 16 (in which we leave out 
					the cubes obfuscating the whole picture and additionally render 
					the cube A0 as a wire-frame model) helps to clarify the concept:</p>
				<img>
					<url>/img/imp_fig16.jpg</url>
					<alt>Making apparent the origin of the world system</alt>
					<caption>Fig. 16: Making apparent the origin of the world system</caption></img>
				<p>With the origin pointed out 
					(labeled "Origin", at <formula>x<sub>W0</sub>, z<sub>W0</sub></formula>, but at base level 0) 
					it immediately becomes obvious (by following the blue horizontal to the left 
					and then upward to our target corner), that our example point indeed lies above 
					(i.e. to the "North") of the origin. 
					Not much above, though, but after all, <formula>-0.1056</formula> is not that much either.</p>
				<p>As a second example let's look at the coordinate <formula>x<sub>W</sub>=1</formula> and 
					<formula>z<sub>W</sub>=1</formula>. Its elevation is <formula>y<sub>W</sub>=1</formula> (expressed in s). 
					This time, we set <formula>s=47</formula> (length of an edge in pixels).</p>
				<p><formula>x<sub>S</sub> = (<redtext>x<sub>W</sub></redtext>-<greentext>z<sub>W</sub></greentext>)cos(a)s = (<redtext>1</redtext>-<greentext>1</greentext>)<ent>times</ent>0.8944<ent>times</ent>47 = 0<ent>times</ent>0.8944<ent>times</ent>47 = <highlight>0 pixels</highlight></formula></p>
				<p><formula>y<sub>S</sub> = ((<redtext>x<sub>W</sub></redtext>+<greentext>z<sub>W</sub></greentext>)sin(a)-<bluetext>y<sub>W</sub></bluetext>)s = ((<redtext>1</redtext>+<greentext>1</greentext>)<ent>times</ent>0.4472-1)<ent>times</ent>47 = (2<ent>times</ent>0.4472-1)<ent>times</ent>47 = <highlight>-4.9632 pixels</highlight></formula></p>
				<p>5 pixels above the origin seems about right.</p>
			</body>
		</chapter>
	</part>

	<part>
		<heading id="C">Rendering Flat Surfaces</heading>
		<chapter>
			<heading id="C1">Screen Center and World Focus</heading>
			<body>
				<p>Our formulas work well, but in our previous examples we had to deal with negative numbers. 
					Of course, there is nothing wrong with negative numbers per se, 
					but because we were claiming to calculate screen coordinates, 
					we nevertheless would face some difficulties in applying our results. 
					After all, we can not render a pixel at the coordinate <formula>x=0</formula> and 
					<formula>y=-4.9632</formula>, because such a point would lie above the screen's upper edge.</p>
				<p>The problem is due to choice of the origin. In our previous examples, this was the base elevation 
					of the topmost point of the cube A0. Being the origin inherently has the notion 
					of being located at <em>screen</em> coordinates <formula>x=0</formula> and <formula>y=0</formula>.</p>
				<p>This is fine, but it has the drawback, that only a quarter of all world coordinates 
					(more precisely, a quarter of the points at base level) can be transformed into screen coordinates.</p>
				<img>
					<url>/img/imp_fig17.jpg</url>
					<alt>Greyed out areas are outside the screen</alt>
					<caption>Fig. 17: Greyed out areas are outside the screen</caption></img>
				<p>What we need to do is to define a center point in the world system. 
					That center point is to become the center of the screen, 
					and relative to that point all the other transformations 
					from the world coordinate system to the screen coordinate system are going to be calculated.</p>
				<p>Whereas it is no problem to pick such a point in the world coordinate system 
					(it can be virtually any arbitrarily chosen point which we declare to be "the center point"), 
					the definition of the center of the screen (to which the center point needs to be transformed) 
					requires some elaboration. The complication which arises is due to the fact, 
					that the screen has two dimensions with <em>precisely defined lenghts</em> 
					(which is a good thing - otherwise we would not be able to calculate a center).</p>
				<p>So let's focus to the "screen" for a moment. What exactly is the screen? 
					The most appropriate answer might be: it depends what you want it to be. 
					In essence it is just a two-dimensional rectangle into which you want 
					to represent three-dimensional points applying our found formulae. 
					This may be the whole display area which is surrounded by the physical ends of your device, 
					or it may just be a rectangle of arbitrary size which you dedicate to your product 
					(in most operating systems called a "Window"). All in all, however, it does not really matter: 
					the only thing which matters is the <em>length of the two dimensions</em>: 
					we need to know those in order to calculate a center point within your screen.</p>
				<p>So let's, somewhat arbitrarily, define an example screen. 
					Let's say, it has a width of <formula>W<sub>S</sub>=250 pixels</formula> 
					and a height of <formula>H<sub>S</sub>=100 pixels</formula> 
					(the subscript <formula>S</formula> stands for "Screen" again, 
					<formula>W</formula> and <formula>H</formula> denote the Height and Width, resp.) 
					Then it is easy to find the center of the screen: just divide the two lengths by 2 and you're done:				</p>
				<img>
					<url>/img/imp_fig18.jpg</url>
					<alt>Defining the screen's center</alt>
					<caption>Fig. 18: Defining the screen's center</caption></img>
				<p>We will need these coordinates later on, therefore let's give them a dedicated name 
					(whereby the subscript <formula>C</formula> refers to the screen's <em>center</em>):</p>
				<p><formula>x<sub>C</sub> = ScreenWidth / 2</formula></p>
				<p><formula>y<sub>C</sub> = ScreenHeight / 2</formula></p>
				<p>To this Center we want to render an arbitrary point from our world coordinate system. 
					Now, "arbitrary" does not mean, that it does not matter what point we choose: 
					it does matter, because this is the point which an observer of the screen focusses instinctively, 
					virtually perceiving it as the "center of the world" or, maybe better, 
					the "relative center of his world around which the whole world revolves". 
					Or, in yet other terms, the point, where "the action happens".</p>
				<p>Therefore it is typical for isometric projections to associate this center with the observer 
					(most prominently featured in computer games, where it is this point at which the player's avatar 
					is located). This is an important property, because it implies, that although the screen's center 
					is fix (at least as long as the dimensions of the screen themselves don't change), 
					the world's center of interest is dynamic and may change 
					(for example will our aforementioned avatar not stand still all the time, 
					but move in one way or the other, 
					thus relocating the world's center of interest while still being displayed at the screen's center).</p>
				<p>The quintessence of this is, that it is the world which seems to move. 
					This directly implies, that we need to manipulate our calculated <formula>x<sub>S</sub></formula> 
					and <formula>y<sub>S</sub></formula> in one way or the other, 
					such that the chosen point of interest lies directly on the screen's center.</p>
				<p>Let's say, that we wanted the center of the top surface of cube B1 to be the world's center 
					(for example because a player's avatar is standing on this particular spot). 
					Let's call this point <em>Focus</em> from now on to clearly distinguish it from 
					the term <em>Center</em>, which we will exclusively use when we mean the screen's center.</p>
				<img>
					<url>/img/imp_fig19.jpg</url>
					<alt>Defining the world's focus</alt>
					<caption>Fig. 19: Defining the world's focus</caption></img>
				<p>To match the (world's) Focus with the (screen's) Center is a 2-step process. 
					Firstly, we need to calculate the focus' coordinates within the world coordinate system 
					(this is, because the center of the top surface area is not a given point already: 
					only the four corners of the surface are known à priori). 
					Secondly, we need to "move" this point in some way, 
					so that its coordinates eventually match the Center 
					(this second operation, known as a Translation, will turn out to consist of two substeps, 
					so that we might as well speak of a 3-way process).</p>
				<p>First things first. 
					The calculation of the Focus might appear to be a trivial operation at first glance, 
					but I can assure you, that this impression is false. 
					It looks such trivial just because the surface of our cube is "flat", 
					i.e., all corners have the same elevation and thus the plane is parallel to "ground zero". 
					Things will turn out to be slightly more complicated, 
					when the corners do not all have this facilitating property. 
					In particular will we not be able anymore to treat the surface as a rhombus
					like we are doing for now, but need to look at it as compound triangles. 
					More of that later, though.</p>
				<p>When the surface is flat, the Focus' coordinates can easily be calculated: 
					just take the topmost corner's coordinates and go downwards half the distance 
					toward its opposite corner, or take the leftmost corner and go halfway 
					toward that one's opposite corner. 
					Putting these two options together, using one property of each, we could easily achieve our goal: 
					just use the <formula>x<sub>W</sub></formula> coordinate of the topmost corner 
					and the <formula>y<sub>W</sub></formula> coordinate of the leftmost corner 
					and we have the desired coordinates of our Focus. 
					Note, however, that doing so we would leave the isolated perspective of viewing at a single point
					for the first time: this operation involves two points (the two mentioned corners). 
					This is necessary and unavoidable in many instances, 
					but for the moment being we'd like to stick with the single-point view of things.</p>
				<p>Well, of course, we know <formula>h</formula> already: 
					we were doing calculations with it all the time: 
					<formula>h=sin(a)s=sin(26.565°)s=0.4472s</formula> (
					with <formula>s</formula> being the cube's edge length).</p>
				<p>So, for the moment being, it suffices to add <formula>sin(a)s</formula> 
					to the <formula>y<sub>S</sub></formula> coordinate of our generalized formula. 
					Because the Focus' coordinates are important, as we will see, 
					it makes sense to assign the resulting screen coordinates 
					an own subscript <formula>O</formula> for <em>Origin</em>. 
					Remember, however, that <formula>O</formula> is in the screen coordinate system, 
					otherwise denoted with the subscript <formula>S</formula>. 
					We also will define a subscript <formula>F</formula> for <em>Focus</em> to indicate, 
					that we mean a special point within the world coordinate system. Then the formulae look like this:</p>
				<p><formula>x<sub>O</sub> = <highlight>(<redtext>x<sub>F</sub></redtext>-<greentext>z<sub>F</sub></greentext>)cos(a)s</highlight></formula> (unchanged)</p>
				<p><formula>y<sub>O</sub> = ((<redtext>x<sub>F</sub></redtext>+<greentext>z<sub>F</sub></greentext>)sin(a)-<bluetext>y<sub>F</sub></bluetext>)s + sin(a)s = ((<redtext>x<sub>F</sub></redtext>+<greentext>z<sub>F</sub></greentext>)sin(a)-<bluetext>y<sub>F</sub></bluetext>+sin(a))s = <highlight>((<redtext>x<sub>F</sub></redtext>+<greentext>z<sub>F</sub></greentext>+1)sin(a)-<bluetext>y<sub>F</sub></bluetext>)s</highlight></formula></p>
				<p>It turns out, that after factoring in the sine the formula is not really 
					much more time-consuming than before: we just need to add <formula>1</formula> at the right place.</p>
				<p>For the Focus of our cube's surface this results in:</p>
				<p><formula>x<sub>O</sub> = (<redtext>x<sub>F</sub></redtext>-<greentext>z<sub>F</sub></greentext>)cos(a)s = (<redtext>1</redtext>-<greentext>1</greentext>)<ent>times</ent>0.8944<ent>times</ent>47 = <highlight>0</highlight></formula></p>
				<p><formula>y<sub>O</sub> = ((<redtext>x<sub>F</sub></redtext>+<greentext>z<sub>F</sub></greentext>+1)sin(a)-<bluetext>y<sub>F</sub></bluetext>)s = ((<redtext>1</redtext>+<greentext>1</greentext>+1)<ent>times</ent>0.4472-1)<ent>times</ent>47 = (3<ent>times</ent>0.4472-1)<ent>times</ent>47 = <highlight>16.0552</highlight></formula></p>
				<p>Now compare this with the coordinates we got in an earlier example for the topmost corner of our cube: 
					they were <formula>x<sub>S</sub>=0</formula> and <formula>y<sub>S</sub>=-4.9632</formula>: 
					the Focus is <formula>16.0552-(-4.9632)=21.0184 pixels</formula> lower now, 
					which unsurprisingly happens to be <formula>h=sin(a)<ent>times</ent>s=0.4472<ent>times</ent>47=21.0184</formula>, 
					exactly the component we plugged in.</p>
				<p>Recall, that so far our formulas for<formula> x<sub>S</sub></formula> 
					and <formula>y<sub>S</sub></formula> were relative to the base elevation 
					of the uppermost corner of the first cube A0. 
					Now we want them to be relative to the Focus at <formula>x<sub>O</sub></formula> 
					and <formula>y<sub>O</sub></formula>. To make them relative to the Focus, 
					we will need to subtract the Focus' coordinates (which are relative to A0 themselves) 
					from the other points' screen coordinates. 
					It should be clear immediately, that if we subtract <formula>x<sub>O</sub></formula> 
					and <formula>y<sub>O</sub></formula> from any world-to-screen calculation, 
					we will end up with screen coordinates relative to the screen's origin. 
					For example would the calculation of the Focus itself result in 
					<formula>xO-xO=0</formula> and <formula>yO-yO=0</formula>, which is the screen's origin.</p>
				<p>And by now also the final step is fairly obvious: 
					we don't want the Focus to be displayed at the screen's origin, but at its center, 
					and so we need to add the screen coordinates <formula>x<sub>C</sub></formula> and 
					<formula>y<sub>C</sub></formula> of the center on top of this all.</p>
				<p>Therefore our final formulas will look like this 
					(of course, here we did not factor in the sine as was done for the Focus, 
					because we want to refer to the really mentioned points, and not to the center of an area surface; 
					hence, the term <formula>+1</formula> does not appear in <formula>y<sub>S</sub></formula>):</p>
				<p><formula>x<sub>S</sub> = <highlight>(<redtext>x<sub>W</sub></redtext>-<greentext>z<sub>W</sub></greentext>)cos(a)s-x<sub>O</sub>+x<sub>C</sub></highlight></formula></p>
				<p><formula>y<sub>S</sub> = <highlight>((<redtext>x<sub>W</sub></redtext>+<greentext>z<sub>W</sub></greentext>)sin(a)-<bluetext>y<sub>W</sub></bluetext>)s-y<sub>O</sub>+y<sub>C</sub></highlight></formula></p>
			</body>
		</chapter>
		<chapter>
			<heading id="C2">Translating World to Screen</heading>
			<body>
				<p>Let's check how this all works out for the topmost corner of our singled out cube B1. 
					The corner's coordinates are 
					<formula><redtext>x<sub>W</sub></redtext>=1 and <greentext>z<sub>W</sub></greentext>=1</formula>. 
					Its elevation is <formula><bluetext>y<sub>W</sub></bluetext>=1</formula>. 
					First we do the preliminary tasks and calculate the (screen) <em>Center</em> 
					(the screen still being assumed to have a width of 250 pixels and a height of 100 pixels) 
					and the <em>Origin</em> as per our cube's <em>Focus</em> point:</p>
				<p><formula>x<sub>C</sub> = ScreenWidth / 2 = 250 / 2 = <highlight>125</highlight></formula></p>
				<p><formula>y<sub>C</sub> = ScreenHeight / 2 = 100 / 2 = <highlight>50</highlight></formula></p>
				<p><formula>x<sub>O</sub> = (<redtext>x<sub>F</sub></redtext>-<greentext>z<sub>F</sub></greentext>)cos(a)s = (1-1)<ent>times</ent>0.8944<ent>times</ent>47 = 0<ent>times</ent>0.8944<ent>times</ent>47 = <highlight>0</highlight></formula></p>
				<p><formula>y<sub>O</sub> = ((<redtext>x<sub>F</sub></redtext>+<greentext>z<sub>F</sub></greentext>+1)sin(a)-<bluetext>y<sub>F</sub></bluetext>)s = ((1+1+1)<ent>times</ent>0.4472-1)<ent>times</ent>47 = (3<ent>times</ent>0.4472-1)<ent>times</ent>47 = <highlight>16.0552</highlight></formula></p> 
				<p>Then we can calculate any desired point within the world coordinate system, 
					for example the top corner of cube B1, by applying the formulas for <formula>x<sub>S</sub></formula> 
					and <formula>y<sub>S</sub></formula>:</p>
				<p><formula>x<sub>S</sub> = (<redtext>x<sub>W</sub></redtext>-<greentext>z<sub>W</sub></greentext>)cos(a)s-x<sub>O</sub>+x<sub>C</sub> = (<redtext>1</redtext>-<greentext>1</greentext>)<ent>times</ent>0.8944<ent>times</ent>47-0+125 = 0<ent>times</ent>0.8944<ent>times</ent>47-0+125 = 0-0+125 = <highlight>125</highlight></formula></p>
				<p><formula>y<sub>S</sub> = ((<redtext>x<sub>W</sub></redtext>+<greentext>z<sub>W</sub></greentext>)sin(a)-<bluetext>y<sub>W</sub></bluetext>)s-y<sub>O</sub>+y<sub>C</sub> = ((<redtext>1</redtext>+<greentext>1</greentext>)<ent>times</ent>0.4472-<bluetext>1</bluetext>)<ent>times</ent>47-16.0552+50 = (2<ent>times</ent>0.4472-1)<ent>times</ent>47-16.0552+50 = -4.9632-16.0552+50 = <highlight>28.9816</highlight></formula></p>
				<p>Because the topmost corner of the surface of cube B1 also is 
					the bottommost corner of the surface of cube A0 (which latter happens to be our "Focus cube"), 
					we expect this point to be <formula>h = sin(a)s</formula> above the screen's <em>Center</em>. 
					Since <formula>sin(a)s = 0.4472<ent>times</ent>47 = 21.0184</formula>, 
					and <formula>100/2 - 21.0184 = 28.9816</formula>, we can see that the formula holds.</p>
				<p>Now let's apply the final formulas <formula>x<sub>S</sub></formula> and <formula>y<sub>S</sub></formula> 
					to the coordinates of our 6 cubes once again, using the precalculated 
					values <formula>x<sub>C</sub></formula> and <formula>y<sub>C</sub></formula> 
					as well as <formula>x<sub>O</sub></formula> and <formula>y<sub>O</sub></formula>.
					The values were rounded to the next integer, because we calculate pixel positions:</p>
				<table>
					<row>
						<col></col>
						<col><formula>x<sub>W<redtext>0</redtext></sub></formula></col>
						<col><formula>x<sub>W<redtext>1</redtext></sub></formula></col>
						<col><formula>x<sub>W<redtext>2</redtext></sub></formula></col>
						<col><formula>x<sub>W<redtext>3</redtext></sub></formula></col>
					</row>
					<row>
						<col><formula>z<sub>W<greentext>0</greentext></sub></formula></col>
						<col>
							<formula>x<sub>S</sub>=125</formula><br/>
							<formula>y<sub>S</sub>=-13</formula>
						</col>
						<col>
							<formula>x<sub>S</sub>=167</formula><br/>
							<formula>y<sub>S</sub>=8</formula>
						</col>
						<col>
							<formula>x<sub>S</sub>=209</formula><br/>
							<formula>y<sub>S</sub>=29</formula>
						</col>
						<col>
							<formula>x<sub>S</sub>=251</formula><br/>
							<formula>y<sub>S</sub>=50</formula>
						</col>
					</row>
					<row>
						<col><formula>z<sub>W<greentext>1</greentext></sub></formula></col>
						<col>
							<formula>x<sub>S</sub>=83</formula><br/>
							<formula>y<sub>S</sub>=8</formula>
						</col>
						<col>
							<formula>x<sub>S</sub>=125</formula><br/>
							<formula>y<sub>S</sub>=29</formula>
						</col>
						<col>
							<formula>x<sub>S</sub>=167</formula><br/>
							<formula>y<sub>S</sub>=50</formula>
						</col>
						<emptycol/>
					</row>
					<row>
						<col><formula>z<sub>W<greentext>2</greentext></sub></formula></col>
						<col>
							<formula>x<sub>S</sub>=41</formula><br/>
							<formula>y<sub>S</sub>=29</formula>
						</col>
						<col>
							<formula>x<sub>S</sub>=83</formula><br/>
							<formula>y<sub>S</sub>=50</formula>
						</col>
						<emptycol cols="2"/>
					</row>
					<row>
						<col><formula>z<sub>W<greentext>3</greentext></sub></formula></col>
						<col>
							<formula>x<sub>S</sub>=-1</formula><br/>
							<formula>y<sub>S</sub>=50</formula>
						</col>
						<emptycol cols="3"/>
					</row>
				</table>
				<p>Eventually, let's plot the calculated coordinates to our screen of dimensions 250<ent>times</ent>100 pixels. 
					To see the whole picture, we connect the calculated points with straight lines 
					(even those points which would lie outside the screen area, i.e. have a negative 
					<formula>x</formula> or <formula>y</formula> value, 
					and also those which are larger than the screen's dimensions). 
					Additionally we single out the <em>Center</em> (representing the <em>Focus</em>):</p>
				<img>
					<url>/img/imp_fig20.jpg</url>
					<alt>Formulas applied on a flat surface</alt>
					<caption>Fig. 20: Formulas applied on a flat surface</caption></img>
			</body>
		</chapter>
		<chapter>
			<heading id="C3">Redefining the Focus</heading>
			<body>
				<p>By now we are able to move the "action center" from one spot to another simply 
					by redefining the Focus, i.e. by racalculating the coordinates 
					<formula>x<sub>O</sub></formula> and <formula>y<sub>O</sub></formula>. 
					Let's say, that your application requires to jump to cube A2 from B1. 
					The topmost corner of A2 has the world coordinates 
					<formula>x<sub>W</sub>=2</formula>=2 and <formula>z<sub>W</sub>=0</formula>, 
					and its elevation is <formula>y<sub>W</sub>=1</formula>. 
					Plugging in the according values we get:</p>
				<p><formula>x<sub>O</sub> = (<redtext>x<sub>F</sub></redtext>-<greentext>z<sub>F</sub></greentext>)cos(a)s = (2-0)<ent>times</ent>0.8944<ent>times</ent>47 = 2<ent>times</ent>0.8944<ent>times</ent>47 = <highlight>84.0736</highlight></formula></p>
				<p><formula>y<sub>O</sub> = (<redtext>x<sub>F</sub></redtext>+<greentext>z<sub>F</sub></greentext>+1)sin(a)-<bluetext>y<sub>F</sub></bluetext>)s = ((2+0+1)<ent>times</ent>0.4472-1)<ent>times</ent>47 = (3<ent>times</ent>0.4472-1)<ent>times</ent>47 = <highlight>16.0552</highlight></formula></p>
				<p>It can be observed, that <formula>y<sub>O</sub></formula> did not change when compared with cube A1. 
					This makes sense, because that cube's <em>Focus</em> optically is on the same height as A1's <em>Focus</em>. 
					But, xO did change by <formula>84.0736-0 = 84.0736 pixels</formula>, i.e. the <em>Focus</em> 
					is 84 pixels more to the right now (which means, that the "world moves" to the left by that amount). 
					Note, that <formula>2<ent>times</ent>w = 2<ent>times</ent>cos(a)s = 2<ent>times</ent>0.8944<ent>times</ent>47 = 84.0736</formula>, which is exactly what we got.</p>
				<img>
					<url>/img/imp_fig21.jpg</url>
					<alt>Relocating the Focus</alt>
					<caption>Fig. 21: Relocating the Focus</caption></img>
				<p>The screen's <em>Center</em> does not change, of course 
					(unless we also changed the screen's dimensions). 
					Therefore the only remaining task is to recalculate the new coordinates 
					<formula>x<sub>S</sub></formula> and <formula>y<sub>S</sub></formula> 
					for all world points in order to get the following representation:</p>
				<img>
					<url>/img/imp_fig22.jpg</url>
					<alt>Relocated Focus</alt>
					<caption>Fig. 22: Relocated Focus</caption></img>
				<p>Note, that in a real application we probably would not want to just "jump" to a new <em>Focus</em>, 
					but scroll smoothly from one location to another. 
					Also, we wouldn't recalculate points which are both visible before and after the transition, 
					we would merely move them to their new position, 
					only calculating new points as they are "moved in" at the according edges.</p>
			</body>
		</chapter>
		<chapter>
			<heading id="C4">Redefining the Center</heading>
			<body>
				<p>From time to time the need may arise to redefine the screen's <em>Center</em> as well. 
					This is needed, when the screen's dimensions are changed 
					(for example, when the user resizes the window in which your application renders the world).</p>
				<p>Let's assume, that your user wishes to make the window taller and resizes its height 
					from 100 to 150 pixels. Although he most likely will do so by modifying either 
					the window's top or bottom edge (but not both at the same time), the impact is such, 
					that the height difference is applied to both the top and bottom edges simultaneously, 
					half the height difference at each side: this behaviour keeps the <em>Center</em> centered.</p>
				<img>
					<url>/img/imp_fig23.jpg</url>
					<alt>Dimension changes affect two opposite sides</alt>
					<caption>Fig. 23: Dimension changes affect two opposite sides</caption></img>
				<p>The changed dimensions lead to a recalculation of the 
					<formula>x<sub>C</sub></formula> and <formula>y<sub>C</sub></formula> coordinates:</p>
				<p><formula>x<sub>C</sub> = ScreenWidth / 2 = 250 / 2 = 125</formula></p>
				<p><formula>y<sub>C</sub> = ScreenHeight / 2 = 150 / 2 = 75</formula></p>
				<p>Recalculating all coordinates <formula>x<sub>S</sub></formula> and <formula>y<sub>S</sub></formula>
					for all world points based on fig. 22 then leads to the following output:</p>
				<img>
					<url>/img/imp_fig24.jpg</url>
					<alt>Effects of changed dimensions</alt>
					<caption>Fig. 24: Effects of changed dimensions</caption></img>
				<p>Note, however, that oftentimes it is not necessary to really recalculate all the world coordinates: 
					the points which are already present usually would simply be moved to the new center 
					by shifting them horizontally or vertically as required (in our case 25 pixels downward). 
					Then we only need to calculate the points which are in the newly exposed window parts 
					(and even this part can be omitted if the dimension change results in a shrinking window).</p>
			</body>
		</chapter>
	</part>

	<part>
		<heading id="D">Working with Elevations</heading>
		<chapter>
			<heading id="D1">Number of Elevation Points</heading>
			<body>
				<p>So far we were working with flat surfaces, i.e., elevations of all points having 
					the same height (namely <formula>1<ent>times</ent>s</formula> in all our examples). 
					Let's have a look, what will change when we apply some different elevations. 
					"Applying elevation" is a somewhat fuzzy term, though: where exactly is "elevation" applied? 
					Let's examine this some more in depth.</p>
				<p>First of all there is a point of view that each point on the grid has a dedicated elevation. 
					Let's call such a point a grid point. Grid points are shared by usually 4 surrounding tiles 
					(2 only if the grid point is alog the whole landscape's edge, 
					1 if it's one of the landscape's corners). 
					And then there's the possibility to define an individual elevation for each 
					of all the tiles' 4 corners. Let's call those tile corners. 
					The following pictures visualize the two points of view:</p>
				<p>
					<img float="left" width="177">
						<url>/img/imp_fig25.jpg</url>
						<alt>Grid point shared by 4 tiles</alt>
						<caption>Fig. 25: Grid point shared by 4 tiles</caption></img>				
					<img float="left" width="169">
						<url>/img/imp_fig26.jpg</url>
						<alt>Tile corners pertaining to a dedicated tile</alt>
						<caption>Fig. 26: Tile corners pertaining to a dedicated tile</caption></img>				
				</p>
				<floatclear/>
				<p>These two different point of views both have their advantages and disadvantages. 
					If we do work with grid points, the most obvious advantage is, 
					that we only need to store a minimum amount of elevation data: in particular, 
					storing 1 elevation per tile suffices, as the other 3 corners can be derived 
					from the elevations of the 3 neighboring tiles (since they are shared points). 
					The downside is, that with grid points we can not handle true vertical structures (e.g. cliffs): 
					to define a true vertical structure at a given point in the x/z plane, 
					we in one way or the other need to provide 2 different heights for the y dimension. 
					The tile corners approach is one such way.</p>
				<p>Catching up the previous statement that we "need to provide 2 different heights for the y dimension" 
					could attempt one to think, that we do not really need to store an elevation for each corner 
					of every tile, because this only would duplicate information available anyway from elsewhere. 
					In fact, at first glance it seems to suffice to take the grid point approach, 
					but to store 2 elevations for a single corner of each tile: a lower and an upper elevation. 
					When there is no vertical structure at that point, then the two values will be identical, 
					else their difference tells about the height of the vertical structure. 
					Let's call those two elevations upper elevation and lower elevation. 
					The following picture shows the two elevations for the topmost corner of cube B1 
					(and with that implicitely also the elevations of the according corners of the surrounding cubes):</p>
				<img>
					<url>/img/imp_fig27.jpg</url>
					<alt>Upper and lower elevation of a grid point</alt>
					<caption>Fig. 27: Upper and lower elevation of a grid point</caption></img>				
				<p>There's a major flaw with this approach, though: the interpretation is ambigeous. 
					Let's define some elevations to make this clear:</p>
				<table>
					<row>
						<col></col>
						<multicol cols="3">Topmost corner of</multicol>
					</row>
					<row>
						<col></col>
						<col>B0</col>
						<col>B1</col>
						<col>B2</col>
					</row>
					<row>
						<col>Upper elevation</col>
						<col>1</col>
						<col>2</col>
						<col>2</col>
					</row>
					<row>
						<col>Lower elevation</col>
						<col>1</col>
						<col>1</col>
						<col>2</col>
					</row>
				</table>
				<p>It is clear, that B0 has an elevation of 1 and B2 a such of 2. 
					But how shall B1 be interpreted? There are two possibilities. 
					Let's connect the lines along the x axis:</p>
				<img>
					<url>/img/imp_fig28.jpg</url>
					<alt>Ambigeous interpretation of elevations</alt>
					<caption>Fig. 28: Ambigeous interpretation of elevations</caption></img>				
				<p>The same ambiguity occurs along the <formula>z</formula> axis.</p>
				<p>Therefore, if one needs to represent true vertical structures (such as cliffs in a landscape), 
					there is no way around the tile corners approach (fig. 26).</p>
				<p>Note, however, that there is not always the need to represent true vertical structures. 
					This is particularly the case, when our DEM delivers just a single elevation for any point. 
					Among the DEMs having this property belong all techniques, 
					which obtain their data by measuring "as far as they can see" 
					(i.e. the closest obstacle defines the elevation), but not beyond that point. 
					A prominent example is the NASA's 
					<link loc="ext">
						<url>http://www2.jpl.nasa.gov/srtm/</url>
						<text>External SiteShuttle Radar Topography Mission</text>
					</link>. 
					In such cases it is more convenient to use the Grid Point approach (fig. 25): 
					it simply saves on storage amount and calculation time.</p>
			</body>
		</chapter>
		<chapter>
			<heading id="D2">Elevation Base</heading>
			<body>
				<p>So far, when working with elevations in a flat landscape, 
					we always implied that the base of the elevation was the bottom of our cubes. 
					More precisely: we assumed that there was a base elevation of 0, 
					upon which we erected structures (cubes). 
					This assumption won't change in the further discussion, 
					but it might be worth to point out some properties of the elevation base to have it defined properly:</p>
				<list>
				    <li>The elevation base is a plane defined by the <formula>x</formula> and <formula>z</formula> axes.</li>
				    <li>Every point in the elevation base plane has an elevation of 0.</li>
				    <li>It is from the elevation base that elevations are defined on the vertical <formula>y</formula> axis, 
				    	orthogonal to the <formula>x/z</formula> plane.</li>
				    <li>Elevations may be defined in both directions: if they point upward along 
				    	the positive direction of the <formula>y</formula> axis we call it a positive elevation, 
				    	otherwise a negative elevation.</li>
				</list>
				<p>Probably the most interesting single aspect of these definitions is, that an elevation can be negative. 
					If, however, this property is not desired 
					(for instance because our data structure only allows for positive values), 
					then it is trivial to redefine the base such, that its lowest point translates to 0. 
					Of course, this translation comes at a cost, as we have to find the lowest point first, 
					usually requiring to scan the whole DEM in a preparatory step.</p>
			</body>
		</chapter>
		<chapter>
			<heading id="D3">Revisiting the Formulae</heading>
			<body>
				<p>Now that we have aquired a clearer understanding about the term elevation, 
					let's have another look at the formulae to represent any given DEM coordinate.</p>
				<p><formula>x<sub>S</sub> = (<redtext>x<sub>W</sub></redtext>-<greentext>z<sub>W</sub></greentext>)cos(a)s-x<sub>O</sub>+x<sub>C</sub></formula></p>
				<p><formula>y<sub>S</sub> = ((<redtext>x<sub>W</sub></redtext>+<greentext>z<sub>W</sub></greentext>)sin(a)-<bluetext>y<sub>W</sub></bluetext>)s-y<sub>O</sub>+y<sub>C</sub></formula></p> 
				<p>The blue term <formula><bluetext>y<sub>W</sub></bluetext></formula> is the only one 
					with any relevance to elevation. It transforms the 3D component into a 2D representation 
					by using its true elevation. 
					But didn't we say, that we wanted the elevation to be relative to the elevation of the <em>Focus</em>? 
					That elevation is hidden in the <formula>y<sub>O</sub></formula> term 
					(subscript <formula>O</formula> for <em>Origin</em>):</p>				
				<p><formula>x<sub>O</sub> = (<redtext>x<sub>F</sub></redtext>-<greentext>z<sub>F</sub></greentext>)cos(a)s</formula></p>
				<p><formula>y<sub>O</sub> = ((<redtext>x<sub>F</sub></redtext>+<greentext>z<sub>F</sub></greentext>+1)sin(a)-<bluetext>y<sub>F</sub></bluetext>)s</formula></p> 
				<p>In <formula>y<sub>S</sub></formula>, let's substitute the term <formula>y<sub>O</sub></formula> 
					with the according formula:</p>
				<p><formula>y<sub>S</sub> = ((<redtext>x<sub>W</sub></redtext>+<greentext>z<sub>W</sub></greentext>)sin(a)-<bluetext>y<sub>W</sub></bluetext>)s-((<redtext>x<sub>F</sub></redtext>+<greentext>z<sub>F</sub></greentext>+1)sin(a)-<bluetext>y<sub>F</sub></bluetext>)s+y<sub>C</sub></formula></p> 
				<p>We want to concentrate on the two blue terms. 
					Simplifying the formula by highlighting the for the moment irrelevant parts,
					and then substituting them by capital letters:</p>
				<p><formula>y<sub>S</sub> = (<highlight>(<redtext>x<sub>W</sub></redtext>+<greentext>z<sub>W</sub></greentext>)sin(a)</highlight>-<bluetext>y<sub>W</sub></bluetext>)s-(<highlight>(<redtext>x<sub>F</sub></redtext>+<greentext>z<sub>F</sub></greentext>+1)sin(a)</highlight>-<bluetext>y<sub>F</sub></bluetext>)s+<highlight>y<sub>C</sub></highlight></formula></p> 
				<p><formula>y<sub>S</sub> = (A-<bluetext>y<sub>W</sub></bluetext>)s-(B-<bluetext>y<sub>F</sub></bluetext>)s+C</formula></p> 
				<p>Expanding the formula</p>
				<p><formula>y<sub>S</sub> = (A-<bluetext>y<sub>W</sub></bluetext>)s-(B-<bluetext>y<sub>F</sub></bluetext>)s+C = A<ent>times</ent>s-<bluetext>y<sub>W</sub></bluetext><ent>times</ent>s-(B<ent>times</ent>s-<bluetext>y<sub>F</sub></bluetext><ent>times</ent>s)+C = A<ent>times</ent>s-<bluetext>y<sub>W</sub></bluetext><ent>times</ent>s-B<ent>times</ent>s+<bluetext>y<sub>F</sub></bluetext><ent>times</ent>s+C </formula></p> 
				<p>shows, that because of 
					<formula>(-<bluetext>y<sub>W</sub></bluetext>+<bluetext>y<sub>F</sub></bluetext>)<ent>times</ent>s</formula> 
					the term <formula><bluetext>y<sub>W</sub></bluetext></formula> indeed 
					is relative to <formula><bluetext>y<sub>F</sub></bluetext></formula>: we correct any movement 
					towards the upper screen edge (<formula>-<bluetext>y<sub>W</sub></bluetext></formula>) 
					by a movement into the other direction (<formula>+<bluetext>y<sub>F</sub></bluetext></formula>), 
					based on the Focus' elevation.</p>
				<p>This is what we wanted to verify. So, are we done? Not quite, unfortunately. 
					Recall the procedure to find the focus (fig. 19): 
					there we assumed, that the surface area of our focus tile was flat 
					(i.e. parallel to the elevation base plane). 
					Because of this, the vertical center was just <formula>h = sin(a)<ent>times</ent>s</formula> further below, 
					i.e. towards the screen's bottom edge. This was fed into our  formula 
					as highlighted:</p>
				<p><formula>y<sub>O</sub> = ((<redtext>x<sub>F</sub></redtext>+<greentext>z<sub>F</sub></greentext><highlight>+1</highlight>)sin(a)-<bluetext>y<sub>F</sub></bluetext>)s</formula></p> 				
				<p>(Note, that <formula>x<sub>O</sub></formula> is affected in no way: 
					the focus' elevation impacts only the vertical screen position, never the horizontal one.)</p>
				<p>Unfortunately, the surface of the focus tile does not necessarily need to be flat. 
					So, how do we find out the true value in order to redefine our simplified formula? 
					The next section deals with this last aspect in our quest of deriving the final formula.</p>
			</body>
		</chapter>
		<chapter>
			<heading id="D4">Averaged Center Elevation</heading>
			<body>
				<p>Let's go back to our cube and examine its surface appearance 
					when given different elevations to its 4 corners. 
					We examine 3 cases with the following elevations:</p>
				<table>
					<row>
						<col></col>
						<col>Case A</col>
						<col>Case B</col>
						<col>Case C</col>
					</row>
					<row>
						<col>Topmost corner</col>
						<col>1</col>
						<col>2</col>
						<col>2</col>
					</row>
					<row>
						<col>Rightmost corner</col>
						<col>1</col>
						<col>1.5</col>
						<col>1</col>
					</row>
					<row>
						<col>Bottommost corner</col>
						<col>1</col>
						<col>1</col>
						<col>1</col>
					</row>
					<row>
						<col>Leftmost corner</col>
						<col>1</col>
						<col>1.5</col>
						<col>1</col>
					</row>
				</table>
				<p><ptitle>Case A</ptitle>
					There's really not much to point out here: 
					fig. 29 shows the standard case which we dealt with all the time, 
					the surface of the cube being a plane parallel to the base elevation plane:</p>
				<img>
					<url>/img/imp_fig29.jpg</url>
					<alt>Case A. Flat surface parallel to the base elevation plane</alt>
					<caption>Fig. 29: Case A. Flat surface parallel to the base elevation plane</caption></img>
				<p><ptitle>Case B</ptitle> 
					Things start to get somewhat more interesting in fig. 30. 
					Note, however, that the surface still is a perfect plane, 
					although it is not parallel to the base elevation plane any longer.</p>
				<img>
					<url>/img/imp_fig30.jpg</url>
					<alt>Case B. Flat surface, not parallel to the base elevation plane</alt>
					<caption>Fig. 30: Case B. Flat surface, not parallel to the base elevation plane</caption></img>
				<p><ptitle>Case C</ptitle>
					When we were under the impression, that we easily could derive the surface's center for all cases, 
					then fig. 31 and 32 demonstrate that it's not trivial. This is due to the fact, 
					that the given elevations impose an ambiguity, because they can be interpreted in (at least) 2 ways. 
					Both the following interpretations split the rectangular surface area into 2 triangles:</p>
				<p>
					<img float="left" width="200">
						<url>/img/imp_fig31.jpg</url>
						<alt>Case C (a). Any of the diagonals can be interpreted to be connected, 
							in this case forming a ridge line</alt>
						<caption>Fig. 31: Case C (a). Any of the diagonals can be interpreted to be connected, 
							in this case forming a ridge line</caption></img>
					<img float="left" width="200">
						<url>/img/imp_fig32.jpg</url>
						<alt>Case C (b). It is also possible to connect the other diagonal, 
							in this case forming a valley line</alt>
						<caption>Fig. 32: Case C (b). It is also possible to connect the other diagonal, 
							in this case forming a valley line</caption></img>
				</p>
				<floatclear/>
				<p>Although we currently just are looking for a generalization of the focus point, 
					it can safely be assumed, that any non-flat landscape features a multitude of tiles 
					which can not be interpreted unambigeously (i.e. are "type C" tiles). 
					Hence it is imperative to solve the problem not only for the focus tile, 
					but for all tiles which need to be rendered.</p>
				<p>We already mentioned, that "Case C" can be interpreted in at least two ways. 
					This is because it is possible to take better approaches than just guessing 
					which one of the two diagonals to consider. 
					For example could we define, that the elevation at the center of the surface 
					is the arithmetic average of the elevations at the 4 corners. 
					In our case, this would result in an elevation of <formula>(2+1+1+1)/4 = 5/4 = 1.25</formula>. 
					We then would be able to connect each corner individually with the calculated center point, 
					resulting in a total of 4 triangles instead of the former 2 only:</p>
				<img>
					<url>/img/imp_fig33.jpg</url>
					<alt>Introducing averaged elevation at the center</alt>
					<caption>Fig. 33: Introducing averaged elevation at the center</caption></img>
			</body>
		</chapter>
		<chapter>
			<heading id="D5">The Final Formulae</heading>
			<body>
				<p>What exactly does this mean now for our formula calculating the focus' center? 
					Let's look at its vertical coordinate component again, the part in question still highlighted:</p>
				<p><formula>y<sub>O</sub> = ((<redtext>x<sub>F</sub></redtext>+<greentext>z<sub>F</sub></greentext><highlight>+1</highlight>)sin(a)-<bluetext>y<sub>F</sub></bluetext>)s</formula></p>
				<p>One could argue now, that because the tile was flat and parallel to the base elevation plane, 
					each corner being at an elevation of <formula>1<ent>times</ent>s</formula> above the base elevation, 
					the term <formula><highlight>+1</highlight></formula> apparently is nothing else 
					than the average of the 4 corners' elevations already, 
					and because the vertical <formula>y</formula> axis can be represented 1:1 with the effective elevation, 
					it suffices to replace the term <formula>+1</formula> with the effective elevation average. 
					For our calculation above, this was <formula>+1.25</formula>. Right?</p>
				<p>Well, no. First of all, the term <formula>+1</formula> is positive, 
					and since <formula>y<sub>O</sub></formula> desribes the vertical screen coordinate, 
					it goes downward towards the lower edge. A higher elevation 
					(as is the case in our example with <formula>+1.25</formula>) thus must lie further up, 
					towards the upper edge. Furthermore, the term <formula>+1</formula> was not multiplied 
					with <formula>s</formula>, but with <formula>sin(a)</formula>, which is 
					half the "vertical diagonal" on the surface. So, how comes that we have a value 
					of <formula>+1</formula> there? Well, we based the value on the only coordinate 
					we considered back then, and that was the one of the cube's topmost corner. 
					Recall how we derived the center based on the topmost corner. 
					We said: "just take the topmost corner's coordinates and go downward 
					half the distance toward its opposite corner". 
					In fact, the expressions <formula><redtext>x<sub>F</sub></redtext></formula>, 
					<formula><greentext>z<sub>F</sub></greentext></formula> 
					and <formula><bluetext>y<sub>F</sub></bluetext></formula> referred to the coordinates 
					of the topmost corner of our focus tile.</p>
				<p><formula>x<sub>O</sub> = (<redtext>x<sub>F</sub></redtext>-<greentext>z<sub>F</sub></greentext>)cos(a)s</formula></p>
				<p><formula>y<sub>O</sub> = ((<redtext>x<sub>F</sub></redtext>+<greentext>z<sub>F</sub></greentext>+1)sin(a)-<bluetext>y<sub>F</sub></bluetext>)s</formula></p> 
				<p>Of particular interest is not only the expression <formula>+1</formula>, 
					but also the expression <formula>-yF</formula>, as this is the elevation of the topmost corner. 
					And so we arrive at the big picture of it all: 
					from the topmost corner at the base elevation we go up to that corner's real altitude, 
					hence <formula>-<bluetext>y<sub>F</sub></bluetext><ent>times</ent>s</formula>, 
					and then down again half the diagonal with <formula>+1<ent>times</ent>sin(a)<ent>times</ent>s</formula>.</p>
				<p>Because we want to use the average height of all 4 corners now, 
					we will replace the elevation <formula><bluetext>y<sub>F</sub></bluetext></formula> of 
					the topmost corner with that average. And what about the term <formula>+1</formula>? 
					Well, it still remains there, as it is only the viewpoint which changes. 
					Rather than going downwards on the top surface, 
					we do this on the base elevation now: 
					so to speak, we go to the tile's center of its base area first, 
					before applying the averaged elevation there 
					(however, mathematically an order does not matter in translation series).</p>
				<p>The quintessence is, that nothing changes but the interpretation 
					of what <formula><bluetext>y<sub>F</sub></bluetext></formula> signifies. 
					To make this clear, we shall denote the term with 
					<formula><bluetext><overline>y<sub>F</sub></overline></bluetext></formula> 
					from now on, the overline standing for "averaged elevation of all 4 corners of the tile".</p>
				<p>What about <formula><redtext>x<sub>F</sub></redtext></formula> and 
					<formula><greentext>z<sub>F</sub></greentext></formula>, do they change as well? 
					No: they don't have any elevation component and merely state the coordinates 
					of a tile's topmost corner. There is no need to average anything here.</p>
				<p>So, our final formulas for the <em>Focus</em> read:</p>
				<p><formula><highlight>x<sub>O</sub> = (<redtext>x<sub>F</sub></redtext>-<greentext>z<sub>F</sub></greentext>)cos(a)s</highlight></formula></p>
				<p><formula><highlight>y<sub>O</sub> = ((<redtext>x<sub>F</sub></redtext>+<greentext>z<sub>F</sub></greentext>+1)sin(a)-<bluetext>y<sub>F</sub></bluetext>)s</highlight></formula></p>
				<p>Note, that <formula><redtext>x<sub>F</sub></redtext></formula> 
					and <formula><greentext>z<sub>F</sub></greentext></formula> still indicate the topmost corner 
					of the tile which shall act as the focus.</p>
				<p>Also note, that the formulae for xS and yS do not change: 
					they always were referring to a tile's corner, which is assumed to have a dedicated elevation anyway.</p>
				<p>The only new element regarding tiles is the fact, 
					that also for them a center point exists now, acting as the common corner of the 4 triangles 
					constituting that tile's surface. 
					The elevation of that point is the average of the elevations of all 4 points.</p>
				<p>Thus for the 4 corners of any tile (even the focus tile!) remains valid:</p>
				<p><formula><highlight>x<sub>S</sub> = (<redtext>x<sub>W</sub></redtext>-<greentext>z<sub>W</sub></greentext>)cos(a)s-x<sub>O</sub>+x<sub>C</sub></highlight></formula></p>
				<p><formula><highlight>y<sub>S</sub> = ((<redtext>x<sub>W</sub></redtext>+<greentext>z<sub>W</sub></greentext>)sin(a)-<bluetext>y<sub>W</sub></bluetext>)s-y<sub>O</sub>+y<sub>C</sub></highlight></formula></p>
				<p>And since this section is titled "The Final Formulae", let's repeat the (unchanged) formulas 
					for <formula>x<sub>C</sub></formula> and <formula>y<sub>C</sub></formula> as well:</p>
				<p><formula><highlight>x<sub>C</sub> = ScreenWidth / 2</highlight></formula></p>
				<p><formula><highlight>y<sub>C</sub> = ScreenHeight / 2</highlight></formula></p>
			</body>
		</chapter>
	</part>

</page>

