Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions About random&round&clamp

  • About random&round&clamp

    Posted by Adam Chen on January 17, 2012 at 7:06 am

    r = Math.round(random(-1,1))
    v = clamp(r,0,1)

    Why Mr.Frank said that the result has 1/3 chance get 1?
    think about that:
    -1 to-0.5 –> -1
    -0.5 to 0.5 —> 0
    0.5 to1 –> 1
    Why not 1/4?

    Dan Ebberts replied 14 years, 4 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    January 17, 2012 at 2:12 pm

    I think you’re correct. Something like this should work:

    random(3) < 2 ? 0 : 1;

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy