hatrick Posted December 22, 2011 Share Posted December 22, 2011 hi, how i can get propper radomness with expressions... something a bit more advanced as rand() .... ore how i can extend the rand() functionality. thank you Quote Link to comment Share on other sites More sharing options...
Macha Posted December 22, 2011 Share Posted December 22, 2011 (edited) I posted a question about that a while ago and my solution was to "paint" a distribution on to points and then uniformly and randomly sample from it to set a random attribute. It is cumbersome but works and you get the added advantage of being able to have complete freedom over the distribution shape. Other than that there is python of course and a few posts ago Symek posted a nifty resample trick in chops that does a similar thing. You could also try ramping the randomly generated atts. I don't think it's the correct way but sometimes it's good enough. Edited December 22, 2011 by Macha Quote Link to comment Share on other sites More sharing options...
3dbeing Posted December 22, 2011 Share Posted December 22, 2011 How Random is Random? This is a pretty old thread, but Mario posted a vop node in here that outputs a "Uniform" Random... I love that phrase, if that's what you mean by proper. 1 Quote Link to comment Share on other sites More sharing options...
symek Posted December 22, 2011 Share Posted December 22, 2011 how i can get propper radomness with expressions... What do you mean by 'proper'? Stratified, non-deterministic anything else? Quote Link to comment Share on other sites More sharing options...
Macha Posted December 22, 2011 Share Posted December 22, 2011 (edited) How Random is Random? This is a pretty old thread, but Mario posted a vop node in here that outputs a "Uniform" Random... I love that phrase, if that's what you mean by proper. Randomness in 3d is quite interesting too. It's not always so straightforward to get a uniform distribution of points. Consider the following: Create a bunch of points at [0,0,0] and displace them along randomly scaled vectors. The result will not be a sphere of uniform points. The reason for this, I believe, is that even though your length of the vector is truly random you get more points in a given unit volume the closer you are to the center. So they look denser there. If you use the standard random vex functions you will notice a similar behavior. Sometimes a cross-like pattern is visible (close to the axes, so I suspect a similar thing is happening there to what I described). I think by proper Hatrick means a set of functions that give you more control than just plain uniform. Like these: http://en.wikipedia.org/wiki/Probability_distribution and we would have some expressions like these: http://docs.python.org/library/random.html Edited December 22, 2011 by Macha 1 Quote Link to comment Share on other sites More sharing options...
Erik_JE Posted December 23, 2011 Share Posted December 23, 2011 Use Random in Python http://docs.python.org/release/3.1.3/library/random.html. It uses http://en.wikipedia.org/wiki/Mersenne_twister and is very fast and good. Quote Link to comment Share on other sites More sharing options...
majikal Posted December 23, 2011 Share Posted December 23, 2011 Randomness in 3d is quite interesting too. It's not always so straightforward to get a uniform distribution of points. Consider the following: Create a bunch of points at [0,0,0] and displace them along randomly scaled vectors. The result will not be a sphere of uniform points. The reason for this, I believe, is that even though your length of the vector is truly random you get more points in a given unit volume the closer you are to the center. So they look denser there. If you use the standard random vex functions you will notice a similar behavior. Sometimes a cross-like pattern is visible (close to the axes, so I suspect a similar thing is happening there to what I described). that kind of bheavior is quite logic... imagine evenly distributed points along axis between 0 and 1 .. then you rotate points randomly around [0,0,0] ... you get same result... points from 0 to 0,5 will occupay 0.523 volume units (volume of a 0.5 radius sphere) and points between 0.5 and 1 will occupay 4.01 volume units... 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.