Controlled 1-D to 3-D growth mode transition of GaN nanostructures and their optical properties