Question

When I call libnoise's getvalue function with x, y, and z as integers I always get 0 back as a result. Is this normal? When I try 1.25, 0.75, 0.5 as in the tutorial http://libnoise.sourceforge.net/tutorials/tutorial2.html I get the expected result of 0.686347. Specifically I've tried this with integers under 20. Do I just not understand how this works?

Any help is greatly appreciated.

Was it helpful?

Solution

enter image description here

Although Oli Charlesworth is correct, you're getting zeroes at integer values because all zeroes occur at integer values. See the above graph for an easy visual demonstration! The reason why zeroes occur at integers is due to the fact that coherent noise is stipulated to be smooth (as opposed to jagged) and a very easy way to achieve that is to just set zeroes at integers and interpolate pseudorandom numbers between them. The benefit of smooth noise is the fact that it's organic and realistic in nature.

Compare this coherent noise function:

enter image description here

With this non-coherent noise function:

enter image description here

Which one is a mountain most likely to look like? :)

OTHER TIPS

According to http://libnoise.sourceforge.net/noisegen/index.html#gradientnoise, the values at integer coordinates will always be zero.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top