Random Value

 
 
 

Categories

  • Math > Basic

Description

Generates a random value within a range of the specified mean value.

This node can generate many value types. For some types, the there can be several ways to generate such values. Here is how the generation of values of special types is handled:

  • 2D, 3D and 4D vectors: generates random scalars for each of the components of the vector (X, Y, ...). This generates a square distribution range.

  • Rotation, quaternion and 3x3 matrix: generates random values that represent random rotations evenly distributed on a sphere.

  • 4x4 matrix: generates a matrix that represents a random rotation evenly distributed on a sphere, a random scaling, and a random translation.

  • Boolean: generates a random Boolean (true or false) similar to a flip of a coin. The mean and variance have no effect on this type.

  • Color: generates a color with random red, green and blue channels. The alpha channel is not randomized and is equal to the alpha value of the mean color.

The generation of random values for some of these types is arbitrary. You can define other methods of generating random values by combining these results. For example, you can generate a random 3D vector by rotating a unit vector with a random rotation.

Parameters

Distribution Type

Specifies the distribution:

  • Uniform: every value within the variance range is equally likely to be generated.

  • Gaussian (also known as bell curve distribution): values close to the mean value are more likely to be generated. The likelihood smoothly diminishes as values are further from the mean.

  • Triangle: the likelihood diminishes linearly as values are further from the mean.

  • Profile Curve: allows you to sculpt the distribution. The zero X value of the curve corresponds to the mean, while -1 and 1 the limit of the distribution specified by the variance. The curve's values outside of this range are ignored.

Profile

Profile used to modulate the input

Ports

Inputs

Seed

Defines the sequence of random numbers used. If you require that two nodes generate different sets of values with the same parameters, simply assign them different seeds.

Time Varying

True to generate a new set of random numbers at each frame. Otherwise, the same numbers are always returned when the current time changes.

ID

This is the index of the random value in the random value sequence to be returned. Typically, if you want a unique random number for each point of a polygon mesh, for example, connect the index of the component processed to this node. This index can be retrieved with the Get Element Index node. For point clouds, since some points can be added and deleted at each frame, the index of a point is not unique over time. For this case, it is better to use the ID attribute on the points of the point cloud by connecting a Get Data node on "Self.ID" to the ID port.

Mean Value

The value around which the random values will be generated. Generating scalar values with mean value 2.3 and variance 10.0 will return values ranging between -7.7 and 12.3. If the distribution is Gaussian or triangular, then values closest to 2.3 are more likely to occur.

Variance

Specifies the range in which the random values will be generated. The variance is a distance from the mean value.

Outputs

Value

The random value generated.