Monday 28 January 2013

More About random()


More About random()

There are several ways to use random(). If
you call it with no parameters, it will generate
a random number between 0 and 1. If you
provide a single parameter (as in the Random
Time example), it will generate a random number
between 0 and the value of the parameter. If you
provide two parameters, separated by a comma,
it will generate a random number between those
two parameters. It’s important to note that the
parameters can be arrays instead of numbers. For
example, this expression will give you a random 2D
position somewhere within the comp:
random ([thisComp.width,
➥thisComp.height])
In addition to random(), After Effects provides
gaussRandom(), which operates in much the
same way as random() except that the results
have more of a Gaussian distribution to them. That
is, more values are clustered toward the center of
the range, with fewer at the extremities. Another
difference is that with gaussRandom(),
sometimes the values may actually be slightly
outside the specified range, which never happens
with random().

No comments:

Post a Comment