Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Mar 31, 2016 · 5 comments
Open

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

GoogleCodeExporter opened this issue Mar 31, 2016 · 5 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

[deleted comment]

1 similar comment
@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant