In this paper, we present a novel 3D geographical routing algorithm (3DGR) that makes use of the position information to route packets from sources to destinations with high path quality and reliability. The locality and high scalability of this algorithm make it suitable for wireless sensor networks. It provides high adaptability to changes in topology and recovery of link failures which increases its reliability. We also incorporate the battery-aware energy efficient schemes to increase the overall lifetime of the network. To reduce latency, a method of keeping a small record of recent paths is used. We also show that location errors still result in good performance of our algorithm while the same assumptions might yield to bad performance or even complete failures in others. Simulation results show that the power consumption and delay using 3DGR are close to optimal obtainable based on full knowledge of the network.