@pscale += 0.001; @pscale = clamp(@pscale, 0, 0.025)*1.5; int pr; vector uv; float d = xyzdist(1,@P,pr,uv); @P = primuv(1,'P',pr,uv);
This works fine and spawns particles that grow to all be a uniform size. My question is. What do I add or how do I change that code to add some randomness to the size that the grains scale up to. I have tried to wrap my head around the "rand" function inside the clamp function but ended up making everything explode into giant grains.
I KNOW there is a simple solution to this but not having the brain for code just yet out of pure ignorance I don't know what to do. Could anyone help possibly?
ALSO as a bonus for anyone who is super genius. Is there a way to define a determined number of sizes the pscale of grains can be? For example have 5 different sizes that a grain can be based on a seed or even better a probability so I can control how many of each sized grain could show up at spawn?
ALSO ALSO if you could help me with this, Can I use VEX to assign Cd values to each size clone to have the ability to have different materials on different grains based upon their size.
It seems like I'm asking a lot but I'm sure someone here is thinking "Pftt this is just 3 lines of code." And could help me work it out.