Itoo Software Forum

Author Topic: random left and right  (Read 416 times)

themaxxer

  • Newbie
  • *
  • Posts: 6
random left and right
« on: May 06, 2017, 07:12:51 PM »
hello

I try to make curtains that are randomly left and right in different widths... http://c2n.me/3KbJG8o.png

I know I need to tell railclone to put the curtain sometimes left and sometimes right and then add the random width, but how? :)

thanks in advance
themaxxer

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1517
Re: random left and right
« Reply #1 on: May 08, 2017, 12:54:13 PM »
Hi,

Thanks for contacting us.

To do this you can use a random number node and the Selector operator. Basically you need to create two states: one where the curtain is on the left, one where it is on the right. To randomly generate these states you can use the Random Number node with a Minimum value of 1 and a Maximum of 2, set to generate a new value for each spline.



This is wired to a Selector operator's Index property. In the first input you would add your curtains and in the second, an empty "null" segment. When the random number returns 1 you'll get a curtain, when it returns 2 you get nothing. Wire this to the Start input.

Then duplicate the Selector operator and swap the inputs so that the null segment is now in slot 1. Wire this to the End input. Now whenever 1 is returned you'll get a curtain on the left and a null on the right. And when 2 is returned you'll get a null on the left and a curtain on the right.




I've attached a sample setup. I hope that helps, please let me know if you have any further questions.

Many Thanks,

Paul
Paul Roberts
iToo Software