dialupnoises / 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 9 years ago

GoogleCodeExporter commented 9 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 9 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