HI people.

Iīm programming a Perlin Noise generator.

Right now i have a big problem with the noise generator. It has to be a generator but not a random generator. That means, whenever you enter a number it gives you the same correspondant random , but always THE SAME.

Well. i got this from several websites. The rule is that these numbers must be primes:

float noise_function(int x)

{

x = x << 13;

float x2 = pow(x,x);

int t = ( x * (x * x * 60493 + 19990303) + 1376312589) & 0x7fffffff;

return 1.0 - ((float)t/1073741824.0);

}

Iīm supposed to give all X-axis values to this function, and it gives back a semi-random curve.

But it doesnīt , it obviously gives me a stairs-looking function. Like the one in the picture.

What the hell. As it is said here, it should be like this (first image).

http://libnoise.sourceforge.net/noisegen/index.html

Anybody know whatīs the problem?