VOP: Random choose from multiple values?

   36685   2   1
User Avatar
Member
77 posts
Joined: April 2009
Offline
Hi!

I have acrazy Idea: I would use ramp for a random choose from values.

For example, I have 3 values: 0.1, 1, 0.56 with different “possibility” of choose.

I've build a ramp with constant interpolation (check attachment).

So now I will get random number, let say, 0.56. As we can see, this number is placed in the middle of ramp and result will be “1” (second from list).

This working perfectly, but I have a question: How to build or edit this ramp not by hand but inside of VOP?

Or maybe Houdini have native operator for multiple choose?

Thank you in advance!

Attachments:
ramp.JPG (45.3 KB)

User Avatar
Member
590 posts
Joined: Nov. 2005
Offline
there is a switch vop for this
just adjust You range of randomVOP to the range of possibilities and convert it to integer and use this as input
User Avatar
Member
192 posts
Joined: Nov. 2008
Offline
sounds sort of similar to the goal of this one:

http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&p=125306&highlight=#125306 [sidefx.com]

might be of use…
  • Quick Links