How to calculate the height of an object