We use Mapbox services for Open Street Map data and we extrude buildings in 3d using "height" parameter.
We have our own iOS app and if you tap on a building (polygon), it recognizes the tap on the base polygon only. So if you tap on the highest floor of the building - it's not recognizable, only the ground floor.
The task is to write a formula which uses coordinates and height (it's polygon data) in order to recognize a tap on the whole building, not just the ground.
Ray tracing is possible!