Drive around your map

Camilla Mahon
Thu, 06 Oct 2016 08:00:00 -0400

With Mapbox maps, Unity, and Mantle you can recreate and explore any place in the world in virtual 3D. With no prior Unity experience, a drive through San Francisco’s iconic hilly streets took me a few hours to set up after work one night while having a beer.

The place I wanted to drive virtually: Looking inland to San Francisco's North Beach neighborhood.

3D geometries are created in Unity by pulling data from Mapbox’s web tiles directly into the Unity engine from our API. A decoder then uses building footprints, heights, and road data from our Streets product and elevation data from our Terrain product to create fully interactive Unity GameObjects that are styleable and scriptable.

The same view as the above, showing the Mapbox Streets data that 3D geometries are derived from.

After loading up the Mapbox data-driven 3D terrain and cityscape of San Francisco’s northeast corner with the Mantle plugin, I grabbed a car asset and controller from the Unity Asset store, dropped it into the game environment, hooked up a few physics scripts, and set a driving path.

Looking at the Taylor Street driving path over Russian Hill and past Ina Coolbrith Park in San Francisco.

One click to switch us into game mode, and we’re cruising over San Francisco’s Russian Hill on real world terrain, past real world buildings:

driving-sf-edited-trim from Mapbox on Vimeo.


Excited about bringing real world maps to games? Take a look at open positions or hit me up on Twitter!