525
randomSeed
Syntax
the randomSeed
Description
System property; specifies the seed value used for generating random numbers accessed through
the
random()
function.
Using the same seed produces the same sequence of random numbers. This property can be useful
for debugging during development. Using the
ticks
property is an easy way to produce a unique
random seed since the
ticks
value is highly unlikely to be duplicated on subsequent uses.
This property can be tested and set.
Example
This statement displays the random seed number in the Message window:
put the randomSeed
See also
random()
,
ticks
randomVector
Syntax
randomVector()
Description
3D command; returns a unit vector describing a randomly chosen point on the surface of a unit
sphere. This method differs from
vector(
random(10)/10.0,
random(10)/10.0,
random(10)/10.0)
, in
that the resulting vector is guaranteed to be a unit vector.
Examples
These statements create and display two randomly defined unit vectors in the Message window:
vec = randomVector()
put vec
-- vector(-0.1155, 0.9833, -0.1408)
vec2 = randomVector()
put vec2
-- vector(0.0042, 0.8767, 0.4810)
See also
getNormalized
,
generateNormals()
,
normalize
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...