Seismic ray tracing plays a key role in earthquake location, seismic tomography, migration and many other applications. To overcome the difficulty caused by grid-based and layer- based modeling, we describe a 3D complex geologic model as an aggregate of arbitrarily shaped blocks separated by triangulated interfaces. Based on Fermat's principle of stationary travel time, we develop a segmentally iterative ray-tracing (SIRT) method for geological models with generally heterogeneous velocity distribution. The method falls into the bending method category, in which the path points are perturbed by a first-order explicit formula instead of traditional iterative methods. Numerical tests demonstrate that the perturbation scheme of ray tracing is effective in complex 3D heterogeneous block models.