Homing ants have been shown to associate directional information with familiar landmarks. The sight of these local cues might either directly guide the path of the ant or it might activate a landmark-based vector that points towards the goal position. In either case, the ants define their courses within allocentric systems of reference. Here, we show that desert ants, Cataglyphis fortis, forced to run along a devious path can use egocentric information as well. The ants were trained to deviate from their straight homebound course by a wide inconspicuous barrier that was placed between the feeding and nesting sites. At a distant test area, the ants were confronted with an identical barrier rotated through 45 degrees. After passing the edge of the obstacle, the ants did not proceed in the trained direction, defined by the skylight compass, but rotated their courses to match the rotation of the barrier. Visual guidance could be excluded because, as soon as the ants turned around the end of the barrier, the visual cue it provided vanished from their field of view. Instead, the ants must have maintained a constant angle relative to their previous walking trajectory along the obstacle and, hence, must have determined their new vector course in an egocentric way.