maps for developers

The (former) official Mapbox blog. See mapbox.com/blog for current content.

Follow publication

Drive around your map

By Camilla Mahon

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.

02-unity-sf-from-north-beach-cropped

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.

02-mbx-gl-tilt-sf-from-north-beach-cropped

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.

03-unity-sf-driving-path-cropped

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!

Sign up to discover human stories that deepen your understanding of the world.

Written by Mapbox

mapping tools for developers + precise location data to change the way we explore the world

No responses yet

Write a response