views:

28

answers:

1

Hi,

I'd like to position a given amount of circles in a field, whose size is also known. The circle's sizes can be freely choosen (although it should be >0). They may not overlap.

The problem: Performance is critical. Just randomly positioning them and reposition them in case they overlap is not fast enough.

My target is the iPhone, so I'm using Objective-C.

Any ideas?

A: 

Sort your circles by size, then lay them out using a lightmap packing algorithm.

Jason Foreman