Path planning for space vehicles is still a challenging problem although considerable progress has been made over the past decades. The major difficulties are that most of existing methods only adapt to static environment instead of dynamic one, and also can not solve the inherent constraints arising from the robot body and the exterior environment. To address these difficulties, this research aims to provide a feasible trajectory based on quadratic programming(QP) for path planning in three-dimensional space where an autonomous vehicle is requested to pursue a target while avoiding static or dynamic obstacles. First, the objective function is derived from the pursuit task which is defined in terms of the relative distance to the target, as well as the angle between the velocity and the position in the relative velocity coordinates(RVCs). The optimization is in quadratic polynomial form according to QP formulation. Then, the avoidance task is modeled with linear constraints in RVCs. Some other constraints, such as kinematics, dynamics, and sensor range, are included. Last, simulations with typical multiple obstacles are carried out, including in static and dynamic environments and one of human-in-the-loop. The results indicate that the optimal trajectories of the autonomous robot in three-dimensional space satisfy the required performances. Therefore, the QP model proposed in this paper not only adapts to dynamic environment with uncertainty, but also can satisfy all kinds of constraints, and it provides an efficient approach to solve the problems of path planning in three-dimensional space.