This paper focuses on the motion planning for mobile robots in 3D, which are modelled by 6-DOF rigid body systems with nonholonomic constraints. We not only specify the target position, but also bring in the requirement of the heading direction at the terminal time, which gives rise to a new and more challenging 3D motion planning problem. The proposed planning algorithm involves a novel velocity vector field (VF) over the workspace, and by following the VF, the robot can be navigated to the destination with the specified heading direction. In order to circumvent potential collisions with obstacles and other robots, a composite VF is presented by composing the navigation VF and an additional VF tangential to the boundary of the dangerous area. Moreover, we propose a priority-based algorithm to deal with the motion coupling among multiple robots. Finally, numerical simulations are conducted to verify the theoretical results.