Hi!

I have just recently played around a little bit with Perlin's noise function

and I was puzzled by it.

I have implemented a 2D version of it and afterwards I tried to use it to

add turbulence to a bitmap picture. At my very first attempt I discovered

that the resulting picture didn't have any turbulence in it. After having

investigated the problem a bit I discovered that when I passed integer

values (the coordinates of my pixels) to the noise function I always got 0

back, so it was pretty obvious why I couldn't see any turbulence. Obviously

one cannot have a noise function which does not make any noise, so what

should I do about it?

For those technical interrested the zero-value explanation goes as follows:

1) All the computed ease-curve interpolation values will be zero, because

there is no difference between the point of interest and the lowest closest

grid point in the lattice.

2) This means that the dot product of the lowest corner gradient and the

difference vector from this corner is always picked when we do the linear

interpolation.

3) However since the difference vector is zero the dot product also becomes

zero and that is why the return value is zero.

I have currently solved the problem by rescaling my pixel-coordinates into

another parameter-range before looking up my turbulence value. This means I

have turned integer values into "floating"-values, however this does not

seem to be a feasible solution, because the turbulence suddenly depends both

on the number of octaves and the value-range Im scaling with.

Could anybody please tell me if Im doing something wrong or how I should fix

the problem?

Thanks in advance

Kenny