Answer the question
In order to leave comments, you need to log in
How to scatter objects over a certain volume without crossing?
Actually the subject: there is a certain volume XYZ, and N objects that should fit in this volume. How to scatter them randomly so that they are guaranteed not to intersect? I came up with a head-on solution:
1) generate random coordinates
2) mark that these coordinates are occupied
3) at the next iteration
, check if the coordinates are occupied
4) if they are occupied, then repeat everything again
somewhere after 50 objects, the computer begins to noticeably think. Is there any way to do this faster?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question