Loading Vertex Normals From a HeightMap With Single-Byte Fields
							Case Study


		/-------------\/-------------\/-------------\
		|\ ...........||\            ||\            |
		|... .....0...||..\     2    ||         4   | 
		|... \  ... ..||....\        ||    \        | 
		|..... A .....||. ... B      ||      C      | 
		|....... \ ...||... ....\    ||        \    | 
		|....1...... .||....3 ....\  ||     5       | 
		|........... \||.......... .\||            \| 
		18------------19-------------/\-------------/
		18------------19-------------\/-------------\
		|\ ...........||\............||\            |
		|  \.....34...||........36...||       38    | 
		|    \ .......||....\ .......||    \        | 
		|      D......||..... E .....||      F      | 
		|        \....||....... \....||        \    | 
		|   35     \..||....37.......||   39        | 
		|            \||............\||            \| 
		36------------37-------------/\-------------/
		36------------37-------------\/-------------\
		|\            ||\            ||\            |
		|        68   ||        70   ||       72    | 
		|    \        ||    \        ||    \        | 
		|      G      ||      H      ||      I      | 
		|        \    ||        \    ||        \    | 
		|   69        ||    71       ||   73        | 
		|            \||            \||            \| 
		\-------------/\-------------/\-------------/

(Vert-(GLuint)Vert/m_WidthVert)*m_TessLevel = Tri 0 for Vert 0, Tri 2 for vert 1, etc

Let's say we're finding the normal for vertex 19 (vertex ABDE). I will need to find face normals
for triangles 0, 1, 3, 35, 37, and 38. Assuming Vtx = 19, that makes for the following tri's:

0 =Vert-m_WidthVert-2
1 =Vert-m_WidthVert-1
3 =Vert-m_WidthVert+1
34=Vert+m_WidthVert
36=Vert+m_WidthVert+2
37=Vert+m_WidthVert+3

For Each Vertex
{
	Get the face normal of each adjacent face, and add one to AdjFaceCount for each successful face normalization
	add all these normals up, and divide by AdjFaceCount
	thats my bloody vertex normal! hurrah!
}

For Each Face
{
	if ( Face Doesnt Exist )
		return 0;
	get 4 vertices that describe face
	get two double vectors in an X pattern
	compute cross product (EWWWW)
	normalize vector
	try to fuck with the normal and put it into an array to be used for collision detection :(
	add the normal to InVector
}
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////

For Each Vertex
{
	NSumX = Abs( Height(Vert-1) - Height(Vert+1) );				//Find the difference in height between two surrounding vertices on x axis
	if ( NSumX == 0 ) NSumX = Height(Vert) - Height(Vert-1);	//If left and right points are the same height, just find the difference in height some other way
	NxL	= ( Height(Vert-1)/NSumX - Height(Vert)/NSumX ) / 2;	//Find the normal of the left edge on the x axis
	NxR = ( Height(Vert)/NSumX - Height(Vert+1)/NSumX ) / 2;	//Find the normal of the right edge on the x axis
	Nx  = ( NxL + NxR ) / 2;									//Average the normals of the left and right edges on the x axis

	NSumY = Abs( Height(Vert-MapWidth) - Height(Vert+MapWidth) );	//Find the difference in height between two surrounding vertices on y axis
	if ( NSumY == 0 ) NSumY = Height(Vert) - Height(Vert-MapWidth);	//If left and right points are the same height, just find the difference in height some other way
	NyL	= ( Height(Vert-MapWidth)/NSumY - Height(Vert)/NSumY ) / 2;	//Find the normal of the left edge on the y axis
	NyR = ( Height(Vert)/NSumY - Height(Vert+MapWidth)/NSumY ) / 2;	//Find the normal of the right edge on the y axis
	Ny  = ( NyL + NyR ) / 2;										//Average the normals of the left and right edges on the y axis

	Nz  = 1.0f - Nx - Ny;
}


bool CWorld::CalcNormal( DWORD ElevRefPt )
{
	float Nx, Ny, Nz, NSumX, NSumY, NxL, NxR, NyL, NyR;
	DWORD Width = m_Width*2+1;								//How many vertices are there, left-to-right?
	
	NSumX = labs( m_ElevationData[ElevRefPt-1] - m_ElevationData[ElevRefPt+1] );				//Find the difference in height between two surrounding vertices on x axis
	if ( NSumX == 0 ) NSumX = m_ElevationData[ElevRefPt] - m_ElevationData[ElevRefPt-1];	//If left and right points are the same height, just find the difference in height some other way
	NxL	= ( m_ElevationData[ElevRefPt-1]/NSumX - m_ElevationData[ElevRefPt]/NSumX ) / 2;	//Find the normal of the left edge on the x axis
	NxR = ( m_ElevationData[ElevRefPt]/NSumX - m_ElevationData[ElevRefPt+1]/NSumX ) / 2;	//Find the normal of the right edge on the x axis
	Nx  = ( NxL + NxR ) / 2;																//Average the normals of the left and right edges on the x axis

	NSumY = labs( m_ElevationData[ElevRefPt-Width] - m_ElevationData[ElevRefPt+Width] );		//Find the difference in height between two surrounding vertices on y axis
	if ( NSumY == 0 ) NSumY = m_ElevationData[ElevRefPt] - m_ElevationData[ElevRefPt-Width];//If left and right points are the same height, just find the difference in height some other way
	NyL	= ( m_ElevationData[ElevRefPt-Width]/NSumY - m_ElevationData[ElevRefPt]/NSumY ) / 2;//Find the normal of the left edge on the y axis
	NyR = ( m_ElevationData[ElevRefPt]/NSumY - m_ElevationData[ElevRefPt+Width]/NSumY ) / 2;//Find the normal of the right edge on the y axis
	Ny  = ( NyL + NyR ) / 2;																//Average the normals of the left and right edges on the y axis

	Nz  = 1.0f - Nx - Ny;

	glNormal3f( Nx, Ny, Nz);

	return S_OK;
}
