Beginner Posted December 12, 2015 Share Posted December 12, 2015 Hi! I want to get random number for every nth of frames in growing range. I got the seed value to change every nth of frame, but problem is that when using fit expression the random number changes because it's fitted to new range. Tried using wrangle in detail mode to add or set attribute for every nth of frame, problem was that it didn't hold the value. I would not prefer to use sop solver to store the value because there's already bunch of solvers and want this to be agile operation after simulation. I solved this temporary by storing @numpt for every nth of frames in my simulation and then after simulation I have seed that changes for same nth frames. But in this way there is no way to change the rate without re-simulating. Anyway it's just to randomly switch crowd simulation's "agentcam" for visualisation purpose.. Quote Link to comment Share on other sites More sharing options...
mart1jn Posted December 13, 2015 Share Posted December 13, 2015 The following expression will get you a random number every 10 frames which is larger than the previous number. Is that what you are asking for? rand(floor($FF/10.0))+floor($FF/10.0) Quote Link to comment Share on other sites More sharing options...
Beginner Posted December 16, 2015 Author Share Posted December 16, 2015 My growing number means increasing total number of particles and the randomly selected number should be one of particle's id. So floor function with fit would work but problem is that when the range to fit changes the random number also changes because it's fitted to new range, even when the seed is same. So now I solved this by storing the number of particles to my own attribute every nth frames and then did random fit with same floor seed rate. Of course the rate is then decided on simulation time, but it's okey in my case. I'm attaching a camera behind particle so if the id is wrong camera wouldn't get right position. It's 3rd perspective view of randomly selected ant in ant crowd simulation, to see closer what's happening Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.