In this study, we investigate the ability of desert ants to gauge the ground distances of sloped sections in a three-dimensional (3D) outbound path. Ground distance estimation, as opposed to a simple measurement of walking distances, is a necessary prerequisite for precise path integration in undulating terrain. We trained ants to visit a feeder along a path that included an angular turn as well as a 'hill', resulting in an outbound path with a distinct 3D structure. We then observed the ants' return path in a test field on level ground. From the angles of the ants' return path on the test field one can infer which property of the hill segment was fed into the ants' path integration module, the actual walking distance or the ground distance. The results show clearly that it is the ground distance that Cataglyphis fortis feeds into its path integrator, and suggest that the ants are able to keep an accurate home vector also in hilly terrain.