Getting started with AR development with Asteroid
Apple’s new presentation at WWDC really focused the future of AR and what it is possible to build. It’s an exciting time for what may be the next computing platform.
The potential to build the next Pokemon Go has many newcomers to AR development looking for a place to get started. This guide will help you get started with Asteroid, an easy-to-use ARKit development tool for creating 3D apps that react to their environment.
Download and Install
To get started with Asteroid, all you need to do is download the Mac app. To use the optional Python scripting feature, you need a development version of python installed, which can be done via Homebrew (instructions here).
For exporting to iOS, you will need XCode 9 or above, and a device that supports ARKit, and an iOS developer account. A slightly outdated guide to getting the right versions of these can be found here.
Layers of reactions
The building block of AR apps in Asteroid is a “reaction”. This is a piece of functionality that notices something happening via the camera, and triggers something happening in 3D.
For example, you might have a yoga pose detector that displays 3D text depending on the pose. If you were making a gym app, you might layer together a bunch of different reactions.
Reactions typically use a CoreML model to sense something happening through the iOS camera — but they might also use mapping, or plane tracking.
Once a reaction has been triggered, it runs its logic to figure out what to render in 3D. In the above case it was 3D text, but it could be an animation, 3D model, anything.
Your first reaction
You can create a reaction in Asteroid without writing a single line of code. Start by adding a camera input object, and import a machine learning model into the blank scene. This will be how we “sense” something happening through the camera.
You can import and add 3D models to the scene. Asteroid works much like a lightweight game engine — you can place and transform objects as you like.
Finally, you can use the switchboard interface to connect the output of an machine learning classifier, to something happening in 3D.
The short gif below shows how to create the yoga pose reaction in seconds, and share it with other developers.
Running on an iPhone
Once you have made an AR app in Asteroid by layering together multiple reactions, you can export your app to iOS. Asteroid automatically generates an XCode project that is ready to run on ARKit ready devices. We’re excited to see what you might build!