randRange

taichi_glsl.randgen.randRange(a=0, b=1)

Generate random floating numbers in range [a, b]. If a and b are n-D vectors, then the return value will also be a n-D vector, whose i-th component is a random number distributed evenly in range [a[i], b[i]], each comonment is generated independently.

Parameters
  • a – Specify the start point of range.

  • b – Specify the end point of range.

Returns

The return value is calculated as a + rand() * (b - a).