I have a Array[] with Rectangles which are all next to each other. I got this by using a flood fill.
I can get the corners of the rectangles to form a Point[]
but then I would need an algorithm to find the outer most points. How do you check if the points are on a border? I know floodfill can calculate the border because it knows when to stop.
Help! I want a method that would take Rectangle[]
and return Point[]
of the outer most vertices so I can do graphics.DrawPolygon(pen, Point[])
.
I just thought of a good algorithm. When I'm in a maze, I just follow the left wall until I find my way back to the starting point. Thanks stackoverflow. Taking the time to write the question really allows me to think creatively.
If anyone have the maze algorithm or know what its called, greatly appreciated.
I just found out about ray-casting. I think I'll be use that by casting vertically from leftmost rectangle to rightmost. Then cast horizontally from top to bottom.