Index: branches/terrain/src/lib/graphics/importer/terrain/terrain.cc
===================================================================
--- branches/terrain/src/lib/graphics/importer/terrain/terrain.cc	(revision 8320)
+++ branches/terrain/src/lib/graphics/importer/terrain/terrain.cc	(revision 8321)
@@ -156,7 +156,46 @@
 }
 
+
+
 void Terrain::getAltitude( Triple& _alt, Triple& _normal )
 {
-	
+	float xScaled = _alt.x / scale.x, zScaled = _alt.z / scale.z;
+	//The offset on the map
+	int xOff =  (int)xScaled, zOff = (int)zScaled;
+	//The interpolation values.
+	float u = xScaled-xOff, v = zScaled-zOff;
+	
+	float dX = scale.x / ( pageSize-1 );
+	float dZ = scale.z / ( pageSize-1 );
+	
+	//If u is bigger than v, we are on the lower triangle...
+	if ( u > v ) {
+		
+		float alt[] = {
+			getAltitude( xOff+0, zOff+0 )*scale.y,
+			getAltitude( xOff+1, zOff+0 )*scale.y,
+			getAltitude( xOff+1, zOff+1 )*scale.y };
+		_alt.y = (1.0f-u)*(1.0-v)*alt[0]+u*(1.0f-v)*alt[1]+u*v*alt[2];
+		
+		//Since we know about the directions of some x and z-coordinates, 
+		//not the whole cross products needs to be calculated. Grab yourself
+		//pen and paper :)
+		_normal.x = -dZ*( alt[0] - alt[1] );				
+		_normal.y = -dZ*dX;
+		_normal.z =  dX*( alt[2] - alt[1] );
+	}
+	else {
+		float alt[] = {
+			getAltitude( xOff+0, zOff+0 )*scale.y,
+			getAltitude( xOff+0, zOff+1 )*scale.y,
+			getAltitude( xOff+1, zOff+1 )*scale.y };			
+		_alt.y = (1.0f-u)*(1.0-v)*alt[0]+(1.0f-u)*v*alt[1]+u*v*alt[2];
+		//Since we know about the directions of some x and z-coordinates, 
+		//not the whole cross products needs to be calculated. Grab yourself
+		//pen and paper :)
+		_normal.x =  dZ*( alt[2] - alt[1] );				
+		_normal.y = -dZ*dX;
+		_normal.z = -dX*( alt[0] - alt[1] );
+	}
 }
 
Index: branches/terrain/src/lib/graphics/importer/terrain/terrain_page.cc
===================================================================
--- branches/terrain/src/lib/graphics/importer/terrain/terrain_page.cc	(revision 8320)
+++ branches/terrain/src/lib/graphics/importer/terrain/terrain_page.cc	(revision 8321)
@@ -65,5 +65,11 @@
 		wantedLOD = TerrainPage::MAX_LODS-1;
 	}	
-	
+	// Calculate the tween factor. This is differently if the LOD is 0.
+	if ( wantedLOD > 0 ) {
+		
+	}
+	else {
+		
+	}
 	return wantedLOD;
 }
Index: branches/terrain/src/lib/graphics/importer/terrain/terrain_page.h
===================================================================
--- branches/terrain/src/lib/graphics/importer/terrain/terrain_page.h	(revision 8320)
+++ branches/terrain/src/lib/graphics/importer/terrain/terrain_page.h	(revision 8321)
@@ -44,4 +44,5 @@
 		 */
 		TerrainPage( Terrain *_owner, int _xOffset, int _zOffset );
+		
 		/**
 		 * This is used only internally for communication between the TerrainPage and
@@ -58,5 +59,5 @@
 		
 		/**
-		 * Makes the terrain look as if it were created with the given level of 
+		 * @brief Makes the terrain look as if it were created with the given level of 
 		 * detail.
 		 */
@@ -64,10 +65,10 @@
 		
 		/**
-		 * Draws a box around the TerrainPage. For debugging purposes.
+		 * @brief Draws a box around the TerrainPage. For debugging purposes.
 		 */
 		void drawBox();
 		
 		/** 
-		 * Calculates the smallest fitting axis aligned bounding box for this TerrainPage.
+		 * @brief Calculates the smallest fitting axis aligned bounding box for this TerrainPage.
 		 */
 		virtual void calculateBounds();		
@@ -75,5 +76,5 @@
 		
 		/**
-		 * Sets the visibility to _flag. If the visibility changed, the vertex and index
+		 * @brief Sets the visibility to _flag. If the visibility changed, the vertex and index
 		 * arrays are allocated or freed, respectively.
 		 */
@@ -81,32 +82,33 @@
 
 		/**
-		 * Prepares the page for rendering.
+		 * @brief Prepares the page for rendering.
 		 */
 		void show( );
 		
 		/**
+		 * @brief Frees most of the memory for economomical reasons.
+		 */
+		void hide( ); 
+		
+		/**
+		 * @brief Updates the tesselation if necessary.
+		 */
+		void updateTesselation( );
+		
+		/**
+		 * @return The current tesselation level.
+		 */
+		int getLOD() { return currentLOD; }
+		
+		/**
+		 * @return The curren tween factor. This is a floating point value  between 0.0f and 1.0f
+		 */
+		float getTween() { return 0.0f; }
+		
+		/**
+		 * @brief Determines the new LOD which should be used by this terrain page based on
+		 * the distance from the camera. 
 		 *
-		 */
-		void hide( ); 
-		
-		/**
-		 * Updates the tesselation if necessary.
-		 */
-		void updateTesselation( );
-		
-		/**
-		 * Returns the current tesselation level.
-		 */
-		int getLOD() { return currentLOD; }
-		
-		/**
-		 * Returns the curren tween factor. This is a floating point value  between 0.0f and 1.0f
-		 */
-		float getTween() { return 0.0f; }
-		
-		/**
-		 * Determines the new LOD which should be used by this terrain page based on
-		 * the distance from the camera. 
-		 * Note: No geometry is updated in this method. You need to call 
+		 * No geometry is updated in this method. You need to call 
 		 * updateTesselation() in order to see a change in geometry. This method is
 		 * just a recommandation.
@@ -118,14 +120,15 @@
 		 * current frame, this function returns true, else you'll get false as the
 		 * return value.
+		 * @return True if the page needs an update and false if not.
 		 */
 		bool isDirty() { return forceTesselation; }
 		
 		/**
-		 * Calculates the maximal errors for every LOD.
+		 * @brief Calculates the maximal errors for every LOD.
 		 */
 		void calculateErrors();
 		
 		/**
-		 * Calculates the error for the given LOD. We just need to know the "worst"
+		 * @brief Calculates the error for the given LOD. We just need to know the "worst"
 		 * vertex for choosing an appropriate LOD.
 		 */
@@ -164,5 +167,5 @@
 		
 		/**
-		 * Returns the next active page
+		 * @return the next active page
 		 */
 		inline pTerrainPage getNext() { return next; }
@@ -174,5 +177,5 @@
 		
 		/**
-		 * Returns the wanted LOD. Make sure you call this method after a call to
+		 * @return Returns the wanted LOD. Make sure you call this method after a call to
 		 * chooseLOD() or you will get screwed values.
 		 */
@@ -180,12 +183,13 @@
 		
 		/**
-	 	 * Removes the page from the active page list.
+	 	 * @brief Removes the page from the active page list.
 		 */
 		void deactivate();
 		
 		/** 
-		 * Inserts the page into the active page list.
+		 * @brief Inserts the page into the active page list.
 		 */
 		void activate();		
+		
 		protected:
 			
@@ -216,4 +220,5 @@
 			int							currentLOD,
 										wantedLOD;
+			float						tween;
 			pTerrainPage 				left, 
 										right,
