Playing with ARKit and the NS API

Recently Apple announced iOS 11 on the WWDC’17 (June 5-9). A very interesting part of this update is ARKit, a framework for augmented reality. Since then many great examples are made and showed on the internet (madewitharkit).

One example I find particularly interesting, is from Andrew Hart. In this example he shows the names of buildings in London floating on top of them. He combines ARKit with CoreLocation. When turning the phone to different parts of the city, different labels are showing up above the respective building.

Printscreen ARKit and CoreLocation by Andrew Hart

After watching the WWDC keynote, I was interested in the simplicity of the usage of ARKit. I started with displaying a white cube in the room I was in. With only a few lines of code it was extremely easy to display an object. I then tried to display some text in front of me. With some helper-code I managed to center the text in front of me.

In The Netherlands our Dutch Rail Company is called “Nederlandse Spoorwegen” or NS. On all stations in The Netherlands about 1 000 000 travelers a day use the train. They (of course) also have an iPhone and Android app to plan a trip. The nice thing is, they also offer an API to do various kinds of things with. The two parts I am interested in are the up-to-date departure times and the station list. When combining these two, I should be able to display travel information based on the current location of the user.

This on itself should be all to difficult or interesting. The extra element I want to add is the AR-part; displaying travel information based on the location of the user and showing fancy 3D-‘cards’ in front of the user when close to the station or when further away above the station’s location. This combines the NS API with CoreLocation and ARKit.

–This article is not finished yet–

Written by Dennis

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *