I mentioned the Hydra limitations before - especially if you aim for the use of your filters in Flash there are a lot of them. One feature that is entirely missing for example is a random number generator in form of a rnd() function. This wouldn't be such a bad thing, if there were at least some binary operators available. Since with the help of a little bitshifting, xor and bitmasking you can build your own random number generator pretty easily - here is a typical C# example:
function Noise(int x, int y)
{
int n = x + y * 57;
n = (n<<13) ^ n;
return ( 1.0 - ( (n * (n * n * r1 + r2) + r3) & 0x7fffffff) / 1073741824.0);
}
Well, it looks like we don't have that in Hydra (yet). Still there is an alternative. By using some nested sine functions with very high frequencies we can get something that looks pretty much like noise:
I admit that this doesn't look too exciting, but I think that there are quite a few things that can be created based on that. So here's the source: sineNoise.hydra
Posted at October 04, 2007 01:42 PM | Further reading






