Localization constitutes one of the key technologies in wireless sensor networks. In the localization method based on anchor node assistance, the motion path of anchor node exerts huge influence on location performance. With the motion path of anchor node pre-determined, the static path planning fails to make full use of the real-time information during the localization, due to which it can not be applied to the area with unknown deployment and abnormal topology. Resorting to artificial potential field theory, this paper raises a three-dimensional dynamic path planning algorithm of mobile anchor node based on virtual force (3D-VFDPP). By the virtue of real-time calculation of the magnitude of virtual force exerted upon anchor nodes by unknown ones in different areas, this algorithm offers online decision of motion direction to instruct the motion of anchor node. The simulation results show that compared with the typical static planning method, it enjoys a far better effectiveness and universality.