I've been playing with randomly putting boxes on a plane. I think I've
come up with a pretty good technique.
I have an 2d array that acts as the plane. When every you place an
object you mark the array. But you don't just mark the location, you
treat the array as if it where a display screen and you paint the object
to it. And you also mark areas that around your object that no other
object could be placed there.
When you randomly choose a location you only have to check if there
is anything at that location. I use #ifdef statement as I don't fill the
2d array with anything except objects.
I've been using boxes and a 300*300 2D array. And getting fairly good
density (99%). And runs times less than 2 min. with display.
Just Bragging :)
I was wondering if any one else has use this technique.
Post a reply to this message
|