I am rendering using the following code:
The interesting thing is that if uncomment
GL11.glDisable(GL11.GL_TEXTURE_2D);
which comes
after surface.draw(), the surface is drawn in white (correctly shaded for the light). If the line above is commented out, all polygons (no matter what color is set for the vertices) are drawn in an ugly blue-green. In no case are the lines drawn in the correct colors.
private void drawSurface()
{
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix();
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
if (zOffset <= 0)
{
zOffset = 0;
}
float adjX = (float) x,
adjY = (float) y,
adjZ = (float) (z + zOffset);
GLU.gluLookAt(adjX, adjY, adjZ,
adjX + angleX, adjY + angleY, adjZ,
0f, 0f, 1f); // rotate so z axis is up
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glEnable(GL11.GL_DEPTH_TEST);
// set lighting
GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, lightPos);
if (surface != null)
{
surface.draw();
}
// GL11.glDisable(GL11.GL_TEXTURE_2D);
if (contourLines != null)
{
contourLines.draw();
}
Display.update();
GL11.glPopMatrix();
}