Undertaker
June 12, 2003 06:05:02
Hi Everybody,
I was wondering if someone knows how to do this :
Let's say I have a surface and 2 primitives ( a box and a sphere for example), how would you “randomly” copy spheres and boxes onto the surface ? I mean with a ramdom percentage of sphere amount and boxes amount .
thanks
old_school
June 12, 2003 08:06:45
Copy Stamping is your answer.
Try this.
In your Copy SOP, go to the stamp folder, create a new Var 1 called choice and Param 1 to rand($PT).
In the Switch SOP's Select Input parameter, put param(“choice”, 0) where $PT is the point number to be processed on the template grid and 0 is the default if you aren't stamping.
Now back to the Copy SOP's stamp folder and turn on Stamp Inputs.
Now you should see random spheres and cubes. To get a different solution, just add a different seed value in your rand() function like rand($PT + 1.9876) where 1.9876 can be any number, big or small to get different solutions. If you want a different solution per frame, use $F as your seed like rand($PT + $F + 1.9876).
Undertaker
June 12, 2003 08:11:31
thanks for the quick answer !