06-18-2014, 04:02 PM
Almost. It has an additional coord scaling into the CubicNoise function, but the principle is the same - generate an array of values:
for (int x = 0; x < SizeX; x++) { double NoiseX = StartX + (EndX - StartX) * x / SizeX; // Go from StartX to EndX in SizeX steps for (int y = 0; y < SizeY; y++) { double NoiseY = StartY + (EndY - StartY) * y / SizeY; // Go from StartY to EndY in SizeY steps CubicNoise2D(NoiseX, NoiseY); } }Similarly for a 3D version, it adds another dimension.