Path planning for Unmanned Underwater Vehicles (UUVs) is a key issue for the success and efficiency of the missions these vehicles perform. This problem is very challenging, because it must cope with dynamic and uncertain models both for the vehicle and for the environment. In the case of ocean gliders, this aspect is critical due to the strong influence of ocean currents on the glider navigation.In this paper, we present a novel path planning scheme for gliders based on iterative optimization that shows promising results on realistic simulations, including highly time-dependent ocean currents. This method models the glider as an intelligent agent that senses the ocean currents speed and direction, and generates an path according to the predefined objectives. The method can be easily configured and adapted to various optimization problems. Here, we include an example of coordinated path planning, in which the paths of a fleet of gliders is optimized, subject to constraints. Also, the proposal reflects accurately the physical vehicle navigation and gives a superior performance when compared with other approaches.