How do I place objects at random places AT a certain radius.
E.g. places on a sphere
OR
How would I place objects at random places on a polygon?
E.g. places on a sphere
OR
How would I place objects at random places on a polygon?
Repeat x# = Rnd(-1,1) y# = Rnd(-1,1) z# = Rnd(-1,1) ; (x,y,z) is random point in cube s# = x*x + y*y + z*z Until s <= 1.0 And s > 0.0 ; reject points outside sphere, or at center. ; (x,y,z) is now a randomly chosen point in the unit sphere. s = Sqr(s) x = x/s ; note that we already made sure s is nonzero. y = y/s z = z/s ; (x,y,z) is now a randomly chosen point on surface of sphere of radius 1. ; Multiply x,y,z by r to get sphere of radius r.