This visualization is essentially a slightly modified terrain visualization.
Therefore, there is not much to say here. The only thing I would like to note is how, having perlin noise, you can achieve the effect of waves..
But there is nothing complicated here.
In fact, we need to shift our noise along, for example, the X axis at each moment of time.
We will get the following result:
Doesn't really look like waves, does it?
Maybe..
So, to fix this, we need to combine different noise values!
That is, in addition to the noise value for the current element of the two-dimensional matrix, we must take some more values from other points of the matrix.
Then just add them up, dividing by the total number of noise values.
Here is some pseudocode:
n1 = noise(x + offset, y);
n2 = noise(x, y + offset);
n3 = noise((matrixWidth - x) + offset, y);
n4 = noise(x, (matrixHeight - y) + offset);
noiseMap[y][x] = (n1 + n2 + n3 + n4) * 0.4;
I am using IntellijIDEA, btw
src/main/java/just/curiosity/wave_3d/Main.java