kevinhicks / simplexnoise

Automatically exported from code.google.com/p/simplexnoise
0 stars 0 forks source link

2D Noise perm[ii + 1] out of bounds #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I believe you forgot to switch out the "%"-operator for the Mod(,) operator in 
the 2d-Generate function as you did in the 3d-Generate. The Way it is now 
doesnt work with negative coordinates.

Thx for putting these up here btw :)

Original issue reported on code.google.com by ferurkel...@googlemail.com on 28 Oct 2013 at 2:15

GoogleCodeExporter commented 8 years ago
Having the same issue, is that how you fixed it?

Switched from method 'Generate(float x, float y)':
int ii = i % 256;
int jj = j % 256;

With:
int ii = Mod(i, 256);
int jj = Mod(j, 256);

This is beyond me, but what you said seems to work! So I assume it's all good 
to go. Hopefully this can be updated, this is a truly great bit of code!

Original comment by will.mj....@googlemail.com on 19 Jun 2014 at 12:33

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I think this is still broken... I've made the changes you guys mentioned but, 
look at the result. There are weird lines in the negative part. This image is a 
7x3 noise grid, the ones at the first line and the first column are the 
negative noises. This is happening in the 3D noise also.

Original comment by phc...@gmail.com on 7 Jul 2015 at 6:16

Attachments:

GoogleCodeExporter commented 8 years ago
Complementing my above post:

If you slice the image in 21 pieces (7x3), you get 21 128x128 noises.

The starting coord of this image is -128x and -128y.

So, the noise at (-128x, -128y) (top-left noise) is just fine. But the noise at 
(-128x, 0y) (center-left noise) is messed up.

Original comment by phc...@gmail.com on 7 Jul 2015 at 2:49