What's a good way to do a random distribution of trees?

If I want a random distribution of trees (or in 3D space maybe stars) so that no tree is too close to another is there a good algorithm for this?

My first thought is to take a lattice such as a hexagonal lattice and just shift each point slightly. Such as if the lattice points were 1 unit apart and allow a drift of about X units then they should still be at least 1-2X units away from each other.

But this leaves a lot of scope for how to choose X which would give different distributions. And also, the probability distribution curve for each drift.

Anyone got experience of a good algorithm?

Found this blog that discusses a couple of methods: http://declanhopkins.com/the-tragedy-of-tree-placement/

You should be able to use Perlin noise and treat it as density, or as a threshold value for placing a tree. The blog also talks about something called Poisson Disk sampling, which I’ve not heard of before, but seems to give decent results.

1 Like