Poisson-Disc-Sampling
Poisson-Disc-Sampling copied to clipboard
Sample a uniformly random point from spawnCentre
The straightforward approach of using Random.Range(radius, 2*radius)
to sample from the annulus around the spawnCentre
unfortunately results in a distribution biased towards the smaller radius.
By using Mathf.Sqrt(Random.Range(radius*radius, 4*radius*radius))
we can generate points uniformly inside the annulus.
These two animations give a good illustration of the difference between the techniques: Annulus Sampling I (the "naive" approach) and Annulus Sampling II (the proposed change).