This article describes a path planning algorithm for fixed-wing UAVs when a real terrain should be considered. Nowadays, many UAVs are required to perform mission flights near given terrain for surveillance, reconnaissance, and infiltration, as well as flight altitude of many UAVs are relatively lower than typical manned aerial vehicles. Therefore, real terrain should be considered in path planning algorithms of fixed-wing UAVs. In this research, we have extended a spline-$RRT^*$ algorithm to three-dimensional planner. The spline-$RRT^*$ algorithm is a $RRT^*$ based algorithm, and it takes spline method to extend the tree structure over the workspace to generate smooth paths without any post-processing. Direction continuity of the resulting path is guaranteed via this spline technique, and it is essential factor for the paths of fixed-wing UAVs. The proposed algorithm confirm collision check during the tree structure extension, so that generated path is both geometrically and dynamically feasible in addition to direction continuity. To decrease degrees of freedom of a random configuration, we designed a function assigning directions to nodes of the graph. As a result, it increases the execution speed of the algorithm efficiently. In order to investigate the performance of the proposed planning algorithm, several simulations are performed under real terrain environment. Simulation results show that this proposed algorithm can be utilized effectively to path planning applications considering real terrain.