I’m having difficulties correctly applying Perlin noise to a circular grid.
When I first computed the noise value, the end of the grid was not matching its beginning anymore… which is normal.
The problem is, when I try to link the beginning to the end of the grid then the noise becomes “symetrical”. And I can’t seem to figure out how to break that symmetry. Is there something wrong or missing with the way I’m computing the 2D noise value ? (terrain[x][y] here below)
If you look at my script you’ll see that the noise value is somewhat similar to the example you’re providing, except it is computed from a 2D array list. There’s unfortunately no solution I can find from these links (not to mention the computation of the noise value from the first sketch is not quite correct).
I changed the amplitude but the idea is the same: you have a symmetry around the 500 value.
This means that for all y, terrain[x][y] = terrain[1000-x][y]
Now if you consider the following set of points
x1 = r * cos(x * angle)
y1 = r * sin(x * angle)
x2 = r * cos((1000 -x) * angle)
y2 = r * sin((1000 -x) * angle)
(x1, y1) is a point of a circle
(x2, y2) is a point on the same circle but opposed to it
And both of those points have the same value -> thus the symmetry you encounter.
Hope it’s clear
EDIT:
To solve your problem you would need to generate a 3D noise.
This way you can use the x-y axis to get your circles loop on themself and use the remaining z axis to generate different circles.
@kfrajer : Yes, I do want to avoid the symmetry while having the edges connected.
@tony : Thanks, I’ve tried interpolation before but found that it doesn’t look good with noise, you kind of see there’s something off with the end of the circle’s motion. I also feel it’s more a twisted workaround than a real solution to the issue.
@jb4x : I realize my question was not really clear. I do know why I have a symmetrical amplitude because I “noised” the sinus and cosinus of every point on purpose. The “1000” you’re mentionning is nothing but the number of columns (n_cols). It is the only way I found to connect the first and last vertices.
Regarding your suggestion, and if I’m not mistaken, generating a 3D noise would mean that I’m also noising the circles (x ans y coordinates) which I do not want. Only the height should be noised.
This is what I did in the first place (the first noise variable in the sketch above, line 26): the z-value is created from noising the x and y cooridnates. But on a 2D plane, the first and last vertices are not matching at all.
Ho yep, I mixed it up in my head… Forgot that your y was your row value.
Actually no I used another transformation to try out and I was not paying attention enough.
I figured out why there is that symmetry though…
It comes from the noise function. Turns out that the function is symmetric so noise(-x) = noise(x)
Try to give it an offset of your biggest radius and it should work.
I added an offset and now I can’t see any symmetry.
I’ll let you double check to be sure
Oh now I see where my mistake was: the x and y coordinates in the noise variable were incorrect. While your answer is not quite right it did helped me spotting that oversight. Thank you.
You added an abitrary and unnecesseraly high offset to the wrong variables (the lines coordinates). That offset value should be put inside the noise function (offset = 1 is enough)
The lines coordinates inside the noise function should also be multiplied by a very small factor (.003 for instance)