It is of vital importance to plan trajectory for unmanned aircraft vehicle (UAV) completing missions in battlefield. A method to address the real-time problem of low-altitude UAV 3-D trajectory planning in realistic battlefield was proposed. Simplified threat models of battlefield were constructed, and an algorithm based on sharing niched genetic algorithm (NGA) was developed by defining the contrast of gene to change gene-s inheritance characteristic. The improvement made superior genes easy to transmit to the next generation, targeted to accelerate the NGA converging to the global optimum and improve real-time performance of NGA. The algorithm was used to 3-D trajectory planning for UAV in virtual battlefield environments while the 3-D digital terrain space was coded by gridding with constant interval. Experimental results show the effectiveness of the proposed algorithm, and prove it meets the real-time requirement of UAV trajectory planning on-line.