Autonomous airships, or aerobots, designed to traverse large distances or explore other bodies of the solar system require careful management of onboard energy resources. For planetary exploration, available energy has to be used for science data gathering, communication with an orbiter or directly with Earth, altitude control and hazard avoidance, close-up navigation for science site investigation, and surface sampling. Consequently, long-distance traverses should be done by relying as much as possible on external energy sources, and in particular on wind energy. In this paper, we address the problem of planning opportunistic flight paths that use know wind fields to carry the aerobot to its destination. We assume that the aerobot is able to control its vertical displacement, while horizontal displacement is to be achieved through wind propulsion. We show how energy minimal and time minimal trajectories can be computed for aerobots traversing layered homogenous wind fields, using an approach that is based on the solution of sets of linear programming problems. Finally, we present illustrative computational results obtained for 2D and 3D wind fields.