|
![](/i/fill.gif) |
> I'm thinking you could probably triangulate all the areas between
> verticies. I.e., build a list of triangles between verticies that don't
> contain any other verticies, and then use the center of each triangle or
> something to represent the "cells", then flood-fill from there as
> appropriate. Does that sound like it would work out? It sounds like a
> lot of brute-force to find those triangles given nothing but the segment
> endpoints. I wonder if you could build the maze that way in the first
> place, plopping down a bunch of randomish triangles and *then* drawing
> edges. Hmmmm...
That's how to do it. If you turn the wall line segments into loops, You
can treat the maze like a complicated polygon and triangulate it as
such. It's not too hard to do yourself, but there's also libraries that
do it for you. Then just pathfind the resulting mesh.
- Slime
Post a reply to this message
|
![](/i/fill.gif) |