Open Marina-t opened 5 years ago
I had a similar issue: Notice that within each of the cells, it's working properly.
For me, it was an off-by-one error. When I casted negative floats to an int, at actually rounds up since it's still just discarding the fractional part.
thanks @Desmeister I am not sure I understand what is the "off-by-one" error, though. For me the fix was to use the smooth function from the book which does add a "1" at the end but doesn't completely follow the description in the file, is that what you are referring to?
Ah no it was a separate problem where int(x) != floor(x) for negative x.
However, I did also run into the problem with the smooth function where multiplying it by -1 and then adding 1 fixes it. That seems to be the difference in inclusion of the absolute value brackets, which aren't present on the wikipedia implementation.
My perlin values don't look very random and I am not sure why. Any one encountered a similar issue?