Maya: Good way to randomize between 3 integers?
on 08-30-2011 09:44 AM
Sorry if this has been covered, could not find it.
I'm using particles and the Instancer feature to scatter geometry around. I have three different source meshes and I created my own UserScalarPP value that use use as my index value. This value is used to choose which of these three meshes will be used for that specific particle.
0 = mesh1
1 = mesh2
2 = mesh3
Here's my question. How do I get a random feature which should give me an even distribution of probabilities between these three integers?
particleShape1.userScalar1PP = rand(0,2); <- This just gives me a float between 0.00-2.00, which is convereted? to an integer. It does work, but is far from even when it comes to probability.
I've tried the usage of +0.5 together with the Floor() command, but that doesn't give an even probability either right?