Created
November 22, 2015 23:42
-
-
Save superckl/68cac4a375f6bea9c060 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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