Before people get all excited: OpenStreetMap barely contains any 3D data. You can get a layout, and guess the height of the houses, if not tagged/stored in OSM, and they usually are not.
So OSM doesn't have much 3D data now but I wonder if maybe that'll change if this sorta thing takes off. If the interface for contributing 3D data (terrain and buildings, say) is well done, and plugins and libraries start to get support then we could see some of the larger cities filling out pretty quickly.
OSM doesn't need terrain data, since it would be very messy to store. And you can just combine OSM data with SRTM/ASTER/etc data if you want "ground heights"
There isn't really support for terrain in OSM. But there probably shouldn't be, there's not really any good way to collect a little bit of elevation data.
For what it's worth, most GPS chips report elevation (however accurate or inaccurate that may be). It could be as "simple" as using the elevation data in the existing traces, assuming they didn't strip that or fail to save it.
Then again, for common elevation data, there are loads of other good sources which can be used in conjunction with OSM, not sure about licensing though.
The problem with elevations from GPS chips are that they are ellipsoidal heights, that is the height from the surface of the ellipsoid used to model the earth. This can be very far from the elevation referred from mean sea level. I think SRTM is still the best way to get elevation data as mentioned by other commenters.
Ah my bad, I'm not familiar with the details of OSM. I figured there'd be some vague support for elevation data so that at least you'd have a nice-ish starting point for modelling a city. Thanks for the clarification though