This demo uses several open-source libraries, and data which is open and free. Leaflet.js draws the underlying map and provides the navigation, with map tiles supplied from the Norwegian Mapping Authorities.
A DTM of 50x50m from the Norwegian Mapping Authorities are loaded into the browser by threejs, which makes WebGL easier to handle. The sun's position is found using SunCalc.js and drawn in the 3D scene by threejs. The 3D world in WebGL is then oriented to align with the underlying map. CSS-transforms is used to keep the alignment correct during zooming and panning.
Buildings and their shadows are drawn on the HTML5 canvas element by the OSMBuildings library. The data is supplied from OpenStreetMap. However, a more accurate version of Trondheim, Norway exists, but is not shown because the data used is not publicly available (FKB-Bygning).