It's possible to make perlin noise a function of a given position. I'm not too sure how exactly, but that'd probably be your solution.
Hmm, currently I generate (essentially) an array of values for the noise.
I've seen something of the sort where you can just call like noise(%x,%y) but I'm not sure how to translate some of the stuff into TorqueScript.
Edit:So I found this code on the matter:
function Noise1(integer x, integer y)
n = x + y * 57
n = (n<<13) ^ n;
return ( 1.0 - ( (n * (n * n * 15731 + 789221) + 1376312589) & 7fffffff) / 1073741824.0);
end function
Correct me if I'm wrong, I'm pretty sure this is just a random generator to produce a random number (between 0 and 1?) based on the seed
n, which is dependent on
x and
y. But I'm not sure how to translate some of that code into TS; anyone know what some of those operators actually do?