• Advertisement
Sign in to follow this  

Overlapping circles perimeter

This topic is 2308 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am making a kind of tower defense game, and I though to add a defensive perimeter to it. I've managed to render it using overlapping circular textures and some shaders, but I'm a bit confused about how to extract the perimeter line to calculate collision. I could just check if each circle intersection point lies within some other circle, but it seems inefficient for large number of circles. I do have a grid structure to test object collision, but I am unsure how it fits into this question.

Are there some known algorithms for this kind of stuff?
[attachment=5943:perimeter.png]

Share this post


Link to post
Share on other sites
Advertisement
One fast way to do it may be to draw the circles on a texture and then calculate the perimeter using some edge detection filter. If the circles do not change often it may also be useful to reuse the result until the data change.

Share this post


Link to post
Share on other sites
Thanks for the idea! Actually, my perimeter is going to be dynamic, but it probably will be fast enough on a rough grid... and I need to write marching squares anyway, so I'll give it a try :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement