A generalized scheme for modelling gravity anomalies of three-dimensional sedimentary basins is presented, and which covers the three cases of constant density contrast, the density contrast varying Linearly with depth and the density contrast varying exponentially with depth. The initial depths to the floor of the sedimentary basin are calculated based on the gravity anomalies at the stations. The differences between the observed and calculated anomalies are then used to modify the depths at the stations. The gravity anomalies of sedimentary basins are calculated by considering parallel vertical cross-sections of the basin. Each vertical cross-section of the basin is replaced by a polygon. Equations are given for the gravity effect of the polygon for the case of constant density contrast and the density contrast varying linearly with depth, in terms of the coordinates of the vertices of the polygon and the density contrast d0 and its rate of variation d1. The gravity effects of these cross-sections are calculated and numerically integrated to get the anomaly of the entire body. For exponential variation in density contrast, each side of the polygon is subdivided into NS segments, along each of which the density contrast is assumed to vary linearly with depth. Gravity effects of all these segments are calculated and summed up for the gravity effect of the entire vertical cross-section. The scheme developed for an exponential variation works automatically for the case of linear variation by simply setting NS = 1 and further reduces to the case of constant density contrast, if d1 = 0.0.