Skip to content

Instantly share code, notes, and snippets.

@superckl
Created November 22, 2015 23:42
Show Gist options
  • Save superckl/68cac4a375f6bea9c060 to your computer and use it in GitHub Desktop.
Save superckl/68cac4a375f6bea9c060 to your computer and use it in GitHub Desktop.
public double[] interpolateY(double[] noise2D, int xWidth, int zWidth){
double[] noise3D = new double[256*xWidth*zWidth];
for(int i = 0; i < xWidth; i++){
for(int j = 0; j < zWidth; j++){
double scale = 0.1D; //Random number I made up
int xzIndex = i*xWidth + j;
double baseN = noise2D[xzIndex]+(noise2D[xzIndex]*128)*scale;
for(int y = 0; y < 256; y++){
noise3D[xzIndex*zWidth+y] = baseN;
baseN -= scale;
}
}
}
return noise3D;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment