Wireless sensor network (WSN) attracts the attention of more and more researchers, and it is applied in more and more environment. The localization information is one of the most important information in WSN. This paper proposed a novel algorithm called the rotated black hole (RBH) algorithm, which introduces a rotated optimal path and greatly improves the global search ability of the original black hole (BH) algorithm. Then, the novel algorithm is applied in reducing the localization error of WSN in 3D terrain. CEC 2013 test suit is used to verify the performance of the novel algorithm, and the simulation results show that the novel algorithm has better search performance than other famous intelligence computing algorithms. The localization simulation experiment results reveal that the novel algorithm also has an excellent performance in solving practical problems. WSN localization 3D terrain intelligence computing rotated the black hole algorithm.