Hello all,

I am working on a C++/OpenGL game where a user draws arbitrary, closed shapes using horizontal and vertical lines only. These closed shapes may be nested in each other, but do not overlap. For the purposes of the next step of the game, the users must place objects around the exterior border of the largest shape. Of course, this means that I must know where the outside is so I can designate that exterior area.

I have no problem finding the largest shape and of course know the coordinates of the lines that make it up, but I need help figuring out how to find the "outside" of the object for the entire perimeter.

I understand the theory behind using ray-tracing to find out if a point is inside or outside of an object, but this does not seem to be an efficient algorithm for my needs.

Does anyone have any suggestions?

Thanks,
Jack