gl.glVertex3f( y, x, nL1); gl.glVertex3f( y+1, x, nL2); gl.glVertex3f(y+0.5f, x+0.5f, L);

gl.glVertex3f( y, x, nL1); gl.glVertex3f( y-1, x, nL2); gl.glVertex3f(y-0.5f, x-0.5f, L);

gl.glVertex3f( x, y, nL1); gl.glVertex3f( x, y+1, nL2); gl.glVertex3f(x+0.5f, y+0.5f, L);

for (int i = 0; i < 256; i++) // For every mcnk chunk{}

wow -> classicx -> yy -> -x

Vector3f ADT_MCNK::GetPosition(){ Vector3f pos(-m_header.posy, m_header.posx, m_header.posz); return pos;}

for (int i = 0; i < 256; i++) // For every mcnk chunk{ Vector3f pos = m_mcnk[i].GetPosition(); for (int x = 0; x < 8; x++) { for (int y = 0; y < 8; y++) { // Get heights } }}

int ADT_MCNK::GetIdNoLOD(int x, int y){ return x + y * 17;}int ADT_MCNK::GetIdLOD(int x, int y){ return 9 + x + y * 17;}

float ADT_MCNK::GetValNoLOD(int x, int y){ return m_mcvt.height[GetIdNoLOD(x, y)];}float ADT_MCNK::GetValLOD(int x, int y){ return m_mcvt.height[GetIdLOD(x, y)];}

for (int i = 0; i < 256; i++) // For every mcnk chunk{ Vector3f pos = m_mcnk[i].GetPosition(); for (int x = 0; x < 8; x++) { for (int y = 0; y < 8; y++) { float h1 = m_mcnk[i].GetValNoLOD(x, y); float h2 = m_mcnk[i].GetValNoLOD(x+1, y); float h3 = m_mcnk[i].GetValNoLOD(x+1, y+1); float h4 = m_mcnk[i].GetValNoLOD(x, y+1); float h5 = m_mcnk[i].GetValLOD(x, y); } }}

for (int i = 0; i < 256; i++) // For every mcnk chunk{ Vector3f pos = m_mcnk[i].GetPosition(); for (int x = 0; x < 8; x++) { for (int y = 0; y < 8; y++) { float h1 = m_mcnk[i].GetValNoLOD(x, y); float h2 = m_mcnk[i].GetValNoLOD(x+1, y); float h3 = m_mcnk[i].GetValNoLOD(x+1, y+1); float h4 = m_mcnk[i].GetValNoLOD(x, y+1); float h5 = m_mcnk[i].GetValLOD(x, y); // Tri A AddVertices(pos.x + (x)*scale, pos.y - (y)*scale, pos.z + h1); // H1 AddVertices(pos.x + (x+1)*scale, pos.y - (y)*scale, pos.z + h2); // H2 AddVertices(pos.x + (x + 0.5f)*scale, pos.y - (y + 0.5f)*scale, pos.z + h5); // H5 // Tri B AddVertices(pos.x + (x+1)*scale, pos.y - (y)*scale, pos.z + h2); // H2 AddVertices(pos.x + (x+1)*scale, pos.y - (y + 1)*scale, pos.z + h3); // H3 AddVertices(pos.x + (x + 0.5f)*scale, pos.y - (y + 0.5f)*scale, pos.z + h5); // H5 // Tri C AddVertices(pos.x + (x+1)*scale, pos.y - (y + 1)*scale, pos.z + h3); // H3 AddVertices(pos.x + (x)*scale, pos.y - (y + 1)*scale, pos.z + h4); // H4 AddVertices(pos.x + (x + 0.5f)*scale, pos.y - (y + 0.5f)*scale, pos.z + h5); // H5 // Tri D AddVertices(pos.x + (x)*scale, pos.y - (y + 1)*scale, pos.z + h4); // H4 AddVertices(pos.x + (x)*scale, pos.y - (y)*scale, pos.z + h1); // H1 AddVertices(pos.x + (x + 0.5f)*scale, pos.y - (y + 0.5f)*scale, pos.z + h5); // H5 } }}