private void recalculateVertices(Globe globe, double verticalExaggeration) { synchronized (elevationLock) { if (elevations != null) { elevations.rewind(); vertices.rewind(); Angle minlon = sector.getMinLongitude(); Angle minlat = sector.getMaxLatitude(); double lonstep = sector.getDeltaLonDegrees() / (width - 1); double latstep = sector.getDeltaLatDegrees() / (height - 1); for (int y = 0; y < height; y++) { Angle lat = minlat.subtractDegrees(latstep * y); for (int x = 0; x < width; x++) { Angle lon = minlon.addDegrees(lonstep * x); double elev = elevations.get() * scale * verticalExaggeration; Vec4 point = globe.computePointFromPosition(lat, lon, elev); vertices.put(point.x).put(point.y).put(point.z); } } } } }