3d Maze in HTML5 and javascript