In general it is impossible (or very difficult) to determine the dependence between the height of the body and its weight.
If the body has a uniform density (homogeneous body), mass and volume then
If the volume is simultaneously the direct proportional function of height then
In this case we have that mass of the body is directly proportional to its height
Or
Suppose we know the shape of the homogeneous body with density and the area of its base. Then we can find the volume of the body as function of its height and find the mass of the body.
For example, cylinder has a base radius Then
Substitute and determine