Simplex noise bug
I have a 3D simplex noise implementation with a weird bug: There seems to be a singularity around (0,0,0), which I can't quite explain, and searching the net found no mention of it, so I must assume it is just something I screwed up in my implementation.
It is modelled after Gustavson's paper.
And this is the code: http://www.pasteit4me.com/26002
The important bit is the -noise3dWithVector: method, starting on line 100. for some reason, if the input of that is close to (0,0,0), it doesn't do the right thing, but I can't quite see why.
If anyone wants to take a stab it, it'd be appreciated, I've been trying to figure this out for two days now, and I am tired of it.
I suspect that the code chooses the "wrong" simplex at (0,0,0), but I don't quite see which would be the right one, or how to remedy the problem.
It is modelled after Gustavson's paper.
And this is the code: http://www.pasteit4me.com/26002
The important bit is the -noise3dWithVector: method, starting on line 100. for some reason, if the input of that is close to (0,0,0), it doesn't do the right thing, but I can't quite see why.
If anyone wants to take a stab it, it'd be appreciated, I've been trying to figure this out for two days now, and I am tired of it.
I suspect that the code chooses the "wrong" simplex at (0,0,0), but I don't quite see which would be the right one, or how to remedy the problem.
Yay, I of course noticed an error five minutes after posting. And it's looking ok now, so hopefully it was THE error. Fixed code for posterity: http://www.pasteit4me.com/25008
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Noise generator | reubert | 7 | 4,042 |
Dec 27, 2007 12:57 PM Last Post: reubert |
|
| Reason for noise instead of texture? | Cochrane | 2 | 1,889 |
Mar 20, 2006 12:00 PM Last Post: Cochrane |
|

