hi guys,
Is there an efficient way to reset random values for a particle.
Let me explain: I give to each particle a randomly generated vector and then manipulate the particle until it reaches that vector. What I will like to accomplish is a way so that once the particle reaches that vector a new random value is generated. I do the comparison with an if statement and set the values with a non-animated random node. So how you guys think is the best way to generate another set of non animated(time varying) random values for whenever the if statement calls it.
Any ideas will be appreciated. Right now I am thinking in using the execute once compound with an animated random node. But I feel I am making this more complicated that it needs to be.
reset random values question
-
xsisupport
- Posts: 713
- Joined: 09 Jun 2009, 09:02
- Location: Montreal Canada
Re: reset random values question
Use a different seed?
-
Butachan
- Posts: 23
- Joined: 31 Jul 2012, 08:48
Re: reset random values question
Well yes, I could use another random node with a different seed but that will create only a second vector. for whenever the particle reaches the first. What I want to accomplish is a progression ad infinitum.... meaning when a particle reaches X1 Vector X2 is produced when it reaches X2 Vector X3 is produced etc etc etc.
-
xsisupport
- Posts: 713
- Joined: 09 Jun 2009, 09:02
- Location: Montreal Canada
Re: reset random values question
off the top of my head...


-
Butachan
- Posts: 23
- Joined: 31 Jul 2012, 08:48
Re: reset random values question
wow,
thanks steve!
You basically randomize the seed by inserting the distance to goal as a variable. I will try to figure out something like that for the context I was working.
I was also thinking in time varying the seed on a per point basis. Anyway thanks for the help. And I hope this also helps someone else witht he same question.
Incidentally, love your blog man.
thanks steve!
You basically randomize the seed by inserting the distance to goal as a variable. I will try to figure out something like that for the context I was working.
I was also thinking in time varying the seed on a per point basis. Anyway thanks for the help. And I hope this also helps someone else witht he same question.
Incidentally, love your blog man.
-
grahamef
- Posts: 281
- Joined: 23 Jun 2009, 19:01
Re: reset random values question
Another alternative would be to use Turbulence instead of Random Value. So effectively each point looks up a value in the turbulence field based on its position. This should be more efficient since the random number generator doesn't keep getting reset (especially on a per-point basis).
-
Butachan
- Posts: 23
- Joined: 31 Jul 2012, 08:48
Re: reset random values question
Ok,
I will post my solution just in case someone need it:
Steve idea of using the point position to randomize the seed proved usefull for my particular tree. Basically the mayor issue was that the random node was inside a field that needed to be calculated each frame. So the solution was to use steve idea to create a random seed from the point position and an if node to activate the random for when the particle reached his age limit. After that I just reset the age and that's it. That's the basis of it. I guess that you could use a turbulize but the issues will be the same.
hope this helps someone.
I will post my solution just in case someone need it:
Steve idea of using the point position to randomize the seed proved usefull for my particular tree. Basically the mayor issue was that the random node was inside a field that needed to be calculated each frame. So the solution was to use steve idea to create a random seed from the point position and an if node to activate the random for when the particle reached his age limit. After that I just reset the age and that's it. That's the basis of it. I guess that you could use a turbulize but the issues will be the same.
hope this helps someone.