-
RANDOMLY DISTRIBUTE INSIDE CIRCLE
Hello!
I’m trying to randomly distribute several (a lot of) layers inside the area of a circle of radius “r” (controlled by a slider). I have this:
const r = 3000; // AT 3000 (>2200) JUST SO IT DOESN’T CRASH
seedRandom(index,true);
var center = [width/2,height/2];
var pos = [0,0];
var dist = length(pos,center); // BY DEFAULT IT’S AT 2200
while (dist > r) pos = random([width,height]);
pos
But as soon as the radius get smaller than the length, After Effects crashes… What am I doing wrong?