Hi everyone,
I’m totally new to Unity, I’m learning with all the tutorial I can find, especially those on Procedural map generation. I have trouble to understand how the Mathf.PerlinNoise() method works.
Lets just writte something like :
for( x=0 → height)
for(yy=0-> width)
noisevalue = Mathf.PerlinNoise(x,y);
noiseArray[x,y] = noisevalue;
and something like :
float divisor;
for( x → height)
for(y-> width)
noisevalue = Mathf.PerlinNoise(x/divisor,y/divisor);
noiseArray[x,y] = noisevalue;
In the first case one obtain always the same value, in the second it looks the way I wanted it (random values from 0 to 1).
I dont get why the first one doesnt work since [x,y] is different at each interation.
Is it because Mathf.PelinNoise(x,y) works in a range of one, thus always giving the same value when x and y are rational numbers ?
I tried with a few value for the divisor, ending sometime with something I like (for 0.3, 0.26, 0.7) and with a blank texture for divisors like 0.5, 0.25, 0.2. It seems only the irrational product of x/divisor and y/divisor gives results.
I’m a bit lost and the documentation for this method is not really deep ( Unity - Scripting API: Mathf.PerlinNoise ). I would really appreciate some clarifications.
Also I’m only used to terminal programmation (with a little bit of SDL with c++ for fun) and I’d like to have a terminal where I can print some simple things, like numbers or string to keep track of what the program is doing. Is there a way to add this ?
Thank you very much.