WhoBuilt

How to hang a painting on the wall with React Native

Sep 14, 2018· 28 min· 602 views·Watch on YouTube

Speaker

React Native consultant Pavlo Babenko of X-Team and three-time CTO at Perfectionist explains how to build an iOS app that previews and places paintings on walls with ARKit and React Native.

Choosing a React Native AR library

Pavlo compares Viro, Expo’s iOS AR support, VeryActive ARKit, UserARKit, and early ARCore projects. For the demo, he chooses React Native ARKit, describing it as open source and feature-rich while noting that other options have limitations or are not production-ready.

Setting up ARKit and placing a painting

The app needs a React Native project with native iOS files, ARKit dependencies, and camera permission. Pavlo starts with a painting displayed one meter in front of the camera, then uses plane detection and hit testing to place it in the scene with the correct position and orientation.

Working around plane detection limits

Pavlo says ARKit can struggle to detect vertical planes on plain, low-contrast walls because it has too few feature points. His workaround asks users to touch the phone to the wall, using the phone’s position to place the painting without waiting for plane detection.

Moving and customizing paintings

The app adds controls to remove a painting and drag it across the wall using gesture tracking and object hit tests. Users can choose among paintings, but image files must first be available locally; grouping the painting and its caption lets them move together.

Capturing a scene and supporting open source

A snapshot feature saves the AR scene as a real-world photo with the virtual painting, without the app’s controls. Pavlo closes by encouraging contributions to open-source AR libraries, including work toward React Native ARCore support.

Takeaways

  • Check a React Native AR library’s platform support, maintenance, and feature set before building around it.
  • Account for poor vertical-plane detection on plain walls; a phone-to-wall placement flow can provide a workaround.
  • Use object hit tests and gestures to let users move an AR object while keeping it on the wall’s plane.
  • Download remote image assets to the device before using them as ARKit materials.
  • Consider contributing missing capabilities, such as Android ARCore support, to open-source AR projects.

Mentioned in this talk

Search inside this talk

What was claimed 14

Show all 14 facts

Related talks