I’m working on a neat little noise function with things like octaves, lacunarity, etc, but I’m having an issue in that the math.noise
function is not working properly. Here’s a snippet of the code:
(amplitude * math.noise(x * frequency, y * frequency, z * frequency))
Which is returning 0. Huh, I thought, and printed out a bunch of stuff. Frequency is 2, amplitude is also 2. I tried printing the x, y, and z values multiplied by the frequency without the noise, which all seem to be working fine. Example: -1024 208 -1024.
So that isn’t the problem. However, when I print math.noise(x * frequency, y * frequency, z * frequency)
with all the same settings, it constantly returns 0. What is going wrong here?
Edit: To help diagnose the problem, here’s what I printed:
print("POSITION:", x * frequency, y * frequency, z * frequency, "NOISE:", math.noise(x * frequency, y * frequency, z * frequency))
And here’s the output for one test:
POSITION: -256 0 -256 NOISE: 0
And noise is 0 for every test!