noise

 
 
 

Returns a random number from -1 to 1 according to a Perlin noise field generator.

float noise(float number)

float noise(float xnum, float ynum)

float noise(vector vector)

number specifies a number that generates a random number. This gives a one-dimensional distribution of return values.

xnum and ynum specify numbers for generating a random number. This gives a two-dimensional distribution of return values.

vector specifies a vector for generating a random number. This gives a three-dimensional distribution of return values.

If you execute this function with the same argument value repeatedly, the function returns the same random value each time it executes.

If you execute this function with an argument value that steadily increases or decreases in fine increments over time, the function returns random values that increase and decrease over time.

Example 1

noise(time)

Returns a value between -1 and 1 each time the expression executes as an animation plays. Because time increases in fine increments, the values returned increase and decrease in smooth, yet random, patterns. If you were to chart the values returned over a period of time, they might occur as in this figure:

Example 2

noise(frame)

Returns a value between -1 and 1 each time the expression executes as an animation plays. Because frame increases in larger increments, the values returned increase and decrease in rougher patterns. If you were to chart the values returned over a period of time, they might occur as in this figure:

The value returned by noise(frame) and noise(time) is the same when frame contains the same number as time. For example, when frame equals 10, noise(frame) returns the same value that noise(time) returns when time is 10.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License