On 16-11-2010 15:03, andrel wrote:
> On 16-11-2010 4:35, Darren New wrote:
>> Darren New wrote:
>>> I'm thinking you could probably triangulate all the areas between
>>> verticies.
>>
>> FWIW, it looks like
>> http://en.wikipedia.org/wiki/Delaunay_triangulation
>> is getting me on the way.
>
> you can use it to generate such a maze though
Probably even more useful if I include the triangles.
Algorithm:
- generate random points in a field (in this case surrounded by lines of
fixed border points, and I removed points to close to one another to get
a more even distribution).
- create a delauney triangulaton
- find all edges of the triangles
- pick a starting triangle
- repeat
- find a triangle that was not used yet and shares an edge with this one
- if you can not find one try another used triangle until you do
- remove the edge
- mark new triangle as used
- pick a new used triangle (I first try this new one, seems to give
nicely complicated mazed, other choices give other mazes.)
- until all triangles are used
remaining edges form the walls of a maze.
Post a reply to this message
Attachments:
Download 'amaze2.png' (30 KB)
Preview of image 'amaze2.png'

|