random number in a switch ?

   8756   4   0
User Avatar
Member
91 posts
Joined: 10月 2015
Offline
random number in a switch

i would like pick a random number from 0 - 3 from a switch please see picture
Edited by gfxfx - 2017年6月25日 14:36:26

Attachments:
dd.jpg (185.2 KB)

User Avatar
Member
433 posts
Joined: 2月 2012
Offline
what are you trying to do ? copy different geo into points?
User Avatar
Member
91 posts
Joined: 10月 2015
Offline
I select a random integer from 0 - 3 so switch picks 1 of 4 sphere or tube or torus or box
User Avatar
Member
8602 posts
Joined: 7月 2007
Online
random number based on what?
let's say for now that you want random number every frame
floor(rand($F)*opninputs("."))
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
1 posts
Joined: 5月 2017
Offline
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?
  • Quick Links