Typically when generating seamless Simplex noise the strategy is to go to 4-dimensions (a strategy which has worked well for me in the past when using 2-D Simplex), however I am trying to generate a seamless GIF loop using 1-D simplex noise (only interested in the noise specifying the Y-value in a line graph).
I'm curious if I'm either misunderstanding how to make things seamless in 1-D or if I possibly have an error in logic here. Basically, I'm generating a 2-D array, where the first dimension is the Z axis and the second dimension is a list of the points (x-y values) for that Z. I iterate over each z and simply plot each vertex in turn.
What I notice is that, when I hit my maximum Z-value, there is a clear jump indicating that I'm doing something wrong (not seamless).
I'm using the fast-simplex-noise
library (I like it better than P5's built-in noise
function) and specify it as so:
function setup() {
let freq = 0.005;
let octaves = 14;
_noise = new FastSimplexNoise({ frequency: freq, octaves: octaves });
// specify the points:
points = [];
step = 0;
maxSteps = 150;
let r = 1.0;
for (let z = 0; z < maxSteps; z++) {
let t = (1.0 * z) / maxSteps;
points[z] = [];
for (let x = o + 10; x < width - o - 10; x++) {
let _n = _noise.get4DNoise(x, z, r*cos(TWO_PI*t), r*sin(TWO_PI*t));
let _y = height/2 + 250*_n;
points[i].push({ x: x, y: _y });
}
}
}
In the draw
function I simply iterate over each vertex in the points
list and keep track of the current z
value per-draw iteration.