4.9.4 Random functions

random

rand( x ) // = random value between 0 and x
rand( x, y ) // = random value within a range between x and y
rand( vec ) // = random vector between 0, 0, 0 and v
rand( vec1, vec2 ) // = random value within a range between v1 and v2

Example:
random( 4 ) // returns a random value between 0 and 4 e.g. 1.256988

more about rand( x )


noise

noise( x ) // = perlin noise of x

Example:
noise( 20 ) // returns 0.40683696, which is a static, explicit random value

more about noise( x )


noise2d

noise2d( vec ) // = 2d perlin noise; A value that depends on the first 2 components of the input vector

Example:
// this returns a random value depending on the x and y position of object
noise2d
( vec( object.Position.X, object.Position.Y, 0 ) )

// this is the same as if you use

noise2d( object.Position )


noise3d

noise3d( vec ) // = 3d perlin noise; A value that depends on 3 input values.

Example:
// alpha opacity will change with the position of the object.
object.Dissolve
= noise3d( object.Position );


noise4d

noise4d( vec4 ) // = 4d perlin noise; A value that depends on 4 input values.

Example:
// alpha opacity will change with the position of object and with time
object.Dissolve = noise4d( object.Position, time );


noise of vector

dnoise( vec ) // = perlin noise vector

Example:
dnoise( vec( 4, 4, 4 ) ) // returns a random vector with the values 1.256988, 1.256988, 1.256988

more about dnoise( x )

 

Xpressionist 3.5