ARKit in Swift Playgrounds @ 404 – The Recap

As mentioned, I spoke at 404 at the Royal Hospital Kilmainham on Saturday, October 7th.

I was demoing a little Swift Playground I had thrown together just after WWDC, when ARKit was announced.

 

The original demo, a flat little SpriteKit-based playground, was not terribly exciting, so I spent a bit of time throwing together a few passes at more engaging content (because, frankly, I was a little panicked this was going to be the most boring demo ever).

ARKit in Action
ARKit in Action

The obvious choice was to make a SceneKit-based playground, with 3D objects. But, after a couple hours in Blender, the realization dawned that I’m not quite a 3D artist just yet.

A 3D pear
A 3D pear?

With my 3D efforts the demo wasn’t much better than the 2D version. So I switched tack. Apple provides some excellent sample code for most of their frameworks, including SceneKit. So I borrowed the supercool fox named Max from the Fox2 SceneKit sample code from Apple and dropped him and his friends into the scene, animations and all. Waaaay better.

I found I couldn’t stop there, and wound up using the light sensing capabilities of ARKit to make an homage to my first apartment in Brooklyn — turn the lights on bright and you could see a horde of bugs appear, turn them down and they magically disappear. If I just introduced my roommates bringing home a cat and making them all disappear, even in the light it’d be a near perfect simulation. Due to the setting, I couldn’t control the lights, so the Brooklyn Apartment playground was out of bounds, but I presented the other two to a crowd of varying size on the day.

Photo Credit: Marc O'Sullivan
Photo Credit: Marc O’Sullivan

The gang who ran 404 did an excellent job with the event; there were loads of interesting speakers and installations. I’ve posted the html version of my slides from the day and a PDF of the presentation with notes (it makes for more interesting reading than the slides on their own, lucky you).

You can get the source code for all these playgrounds from my Github repo, and for your indulgence thus far, here’s a video of the fox in action:

Leave a Reply

Your email address will not be published. Required fields are marked *