# Distribution of Random Numbers

## Recommended Posts

Does anyone know of an easy way to get random numbers (in vopsop preferably) from a probability distribution?

Ideally I'd like to draw a curve in an editor, or use a ramp, and sample from it.

I've kind of come up with a solution where I create a bunch of points, ramp a color (say red) and then randomly (constant distribution) sample from this with the color representing the probability. It works but there should be a prettier way of doing this.

Edited by Macha
##### Share on other sites

I'm not sure that I understand correctly; but to discretely control the values of my random numbers I usually assign standard 0-1 rand, then create an animation curve from frames 0-100, create a new attr that refs both the randAttr and AnimChan -

chf(animChan,randAttr*100)

this gives a lot more control than a ramp, as you can adjust the bezier handles to really get the distribution you are looking for...

-=3db

##### Share on other sites

Hmmmmmm, I think what you do is a similar idea but with a subtle difference. I think you don't change the distribution density but clip it away whereas the method I use makes the distribution denser where the area under the curve would be bigger.

I wish I could post a file!

Edited by Macha
##### Share on other sites

Hmmmmmm, I think what you do is a similar idea but with a subtle difference. I think you don't change the distribution density but clip it away whereas the method I use makes the distribution denser where the area under the curve would be bigger.

I wish I could post a file!

It's not really a clip as much as it is a LUT, but yeah I'm not really sure what you are getting at, cuz on the scatter sop you can scatter bassed on an alternate atribute which determines the probability/density... Alternativiely you can scatter in a volume where desnity=probability..

##### Share on other sites

• 2 years later...

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×