By: Siyu Song
Twin Peaks is a favorite landmark of San Francisco. Between the impressive view and characteristic fog, I thought it would make a fun challenge to build using the Mapbox Unity SDK + ARKit.
Using our latest Unity SDK, I followed Jesse’s tutorial and created my own demo. I wanted to make it as realistic as possible so I inserted 3D models and added an atmospheric effect to create a rolling fog.
No map of Twin Peaks would be complete without Sutro Tower. Using the point of interest metadata in Mapbox’s vector data layer, I was able to place a custom 3D model procedurally using the Factory system in the Mapbox Unity SDK. This process can be repeated to place custom geometry at any location in the world.
To create the rolling fog, I used Unity’s particle system to create a system of semi-transparent 2D sprites that when rendered on top of each other gives a nice atmospheric effect. This technique can be used to create dust, smoke, or even fireworks.
Taking advantage of some improvements in the latest version of the SDK, I was able to connect the map placement in AR space with ARKit’s surface detection. Now you can place and move the map visualization around to any tabletop.
With Mapbox’s global data coverage and the Unity SDK’s procedural generation, you can easily build visualizations that work anywhere in the world. After updating the map’s GPS coordinates, the same effect is rendered at Half Moon Bay below:
Want to try this for yourself? You can download my project and check out the Twin Peaks scene under the /Assets/TwinPeaks in the project to get started. Then, go into the Map object to update the location to your favorite city.
Let me know what you create by sharing it with @Mapbox on Twitter using the hashtag #BuiltWithMapbox!
Twin Peaks with ARKit and Mapbox Unity SDK was originally published in Points of interest on Medium, where people are continuing the conversation by highlighting and responding to this story.