JavaScript Tips and Tricks by Mario Dcunha.


Index


"RandomNoise"


RandomNoise is a quick function framework which I came up with to just understand and toggle between random(), noise() and using both together.

Essentially, this is to relate the numerical output of random() and noise() to the visual canvas. Here is the summary of this toggle-function of how we can learn this:

noise() Taking a low and high limit within the noise() function, and adding a factor of change.

random() Taking the same low and high limits within the random() function, and adding the same factor of change.

"RandomNoise" Taking the same low and high limits within the noise() function, multiplying it by the same random() function, with the same parameters, and adding the same factor of change.

View Code.


What do we understand?

Please note: Remember to change the factor as needed, based on what you are creating. Using the same factor for all modes, may not work well. Changing its multiplier, may yield better and smoother results.