hmt.getTexture().bind(gl);
gl.glCullFace(GL.GL_FRONT);
for(int i = 0; i < (int)(cam1.getXPos() * 10); i++){
gl.glBegin(GL.GL_TRIANGLE_STRIP);
for(int j = 0; j <= (int)((cam1.getZPos()) * 10); j++){
gl.glTexCoord2f((float)i / 239.0f, (float)j / 240.0f);
gl.glVertex3f((float)i / 10, (float)hm.getData(i, j) / 100 - 10, (float)j / 10);
gl.glTexCoord2f((float)(i+1) / 239.0f, (float)j / 240.0f);
gl.glVertex3f((float)(i+1) / 10, (float)hm.getData(i+1, j) / 100 - 10, (float)j / 10);
}
gl.glEnd();
}
for(int i = 238; i > (int)(cam1.getXPos() * 10); i--){
gl.glBegin(GL.GL_TRIANGLE_STRIP);
for(int j = 239; j > (int)((cam1.getZPos()) * 10); j--){
gl.glTexCoord2f((float)(i+1) / 239.0f, (float)j / 240.0f);
gl.glVertex3f((float)(i+1) / 10, (float)hm.getData(i+1, j) / 100 - 10, (float)j / 10);
gl.glTexCoord2f((float)i / 239.0f, (float)j / 240.0f);
gl.glVertex3f((float)(i) / 10, (float)hm.getData(i, j) / 100 - 10, (float)j / 10);
}
gl.glEnd();
}
gl.glCullFace(GL.GL_BACK);
for(int i = 0; i <= (int)(cam1.getXPos() * 10); i++){
gl.glBegin(GL.GL_TRIANGLE_STRIP);
for(int j = 239; j >= (int)((cam1.getZPos()) * 10); j--){
gl.glTexCoord2f((float)i / 239.0f, (float)j / 240.0f);
gl.glVertex3f((float)i / 10, (float)hm.getData(i, j) / 100 - 10, (float)j / 10);
gl.glTexCoord2f((float)(i+1) / 239.0f, (float)j / 240.0f);
gl.glVertex3f((float)(i+1) / 10, (float)hm.getData(i+1, j) / 100 - 10, (float)j / 10);
}
gl.glEnd();
}
for(int i = 238; i >= (int)(cam1.getXPos() * 10); i--){
gl.glBegin(GL.GL_TRIANGLE_STRIP);
for(int j = 0; j <= (int)((cam1.getZPos()) * 10)+1; j++){
gl.glTexCoord2f((float)(i+1) / 239.0f, (float)j / 240.0f);
gl.glVertex3f((float)(i+1) / 10, (float)hm.getData(i+1, j) / 100 - 10, (float)j / 10);
gl.glTexCoord2f((float)i / 239.0f, (float)j / 240.0f);
gl.glVertex3f((float)(i) / 10, (float)hm.getData(i, j) / 100 - 10, (float)j / 10);
}
gl.glEnd();
}