|
|
Samuel Benge wrote:
> Care to give an overview of the algorithm?
My algorithm is similar to Christian's. I start with a 2d array of cells with
all 4 walls up in each cell. Each cell is a 4D vector <x,y,z,t> representing
<N,E,S,W>. Calculate total number of cells, randomly pick entrance and exit
cells from the borders, and make the entrance cell the current cell. Keep a
tally of each cell visited.
For the current cell check neighboring cells to find any with all walls still
up. Pick one of those at random and remove the wall between them, move to that
cell make it the current one, and loop until you've visited all cells or hit a
dead end (no more neighbors with all walls up) In that case, back track until
you find some valid neighbors and continue.
I just uploaded my maze include file and a few sample scenes to p.b.s-f for
anyone that wants to have a go at it.
-------------------------------------------------
www.McGregorFineArt.com
Post a reply to this message
|
|