Search - User list
Full Version: random number in a switch ?
Root » Houdini Learning Materials » random number in a switch ?
gfxfx
random number in a switch

i would like pick a random number from 0 - 3 from a switch please see picture
sepu
what are you trying to do ? copy different geo into points?
gfxfx
I select a random integer from 0 - 3 so switch picks 1 of 4 sphere or tube or torus or box
tamte
random number based on what?
let's say for now that you want random number every frame
floor(rand($F)*opninputs("."))
Callmedude88
I'm new to houdini and expressions in general, but found this formula to work for one of my switches…

round(rand($F* 0.1)*3)

… if you have more than 4 switch connection, say you have 15, then you could change the formula to this…

round(rand($F* 0.1)*14)

This expression allows for random whole numbers from 0 to 14. A total of 15.

Cheers?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB