'Algorithm for determining inside and outside regions of a 3D model (multiple meshes)

I am trying to implement an efficient precomputed culling scheme in my 3D city model viewer program (a user can upload a 3D model of a city from any number of architecture programs, meaning that there can be a huge number of separate different unique meshes). And one major culling optimization that I would like to implement is culling out the interior of buildings when you are outside and culling out every other building when you are inside a model (this will help with frame rate, as I am running on an android device).

How would I algorithmically calculate what is the outside and what is the inside and then differeniate between the different interiors?

I was thinking if there was a way to pre calculate these regions, then during runtime it would be a simple position check against those small number of regions.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source