Design domino art creations that interact with the real world using the ARCore Depth API.
This project is no longer actively maintained by the Google Creative Lab but remains here in a read-only Archive mode so that it can continue to assist developers that may find the examples helpful. We aren’t able to address all pull requests or bug reports but outstanding issues will remain in read-only mode for reference purposes. Also, please note that some of the dependencies may not be up to date and there hasn’t been any QA done in a while so your mileage may vary.
For more details on how Archiving affects Github repositories see this documentation . We welcome users to fork this repository should there be more useful, community-driven efforts that can help continue what this project began. |
Lines of Play is a domino AR experiment built with Unity highlighting recent advancements in ARCore. Unlike previous mobile AR applications limited to horizontal and vertical object placement, AR Core's Depth API allows game objects to interact with real objects in the player’s environment with near surface-level resolution.
Features of the player’s environment provide constraints (on collision) and serve as visual obstructions (occlusion). Players can use Lines of Play to rapidly create and modify lines, rings, paths, and turns of domino tiles.
This app was developed in the Unity Editor and written in C# using the MonoDevelop framework and using ARFoundation. ARFoundation allows build to target both capable iOS and Android devices.
For a list of supported Android devices, check here; for supported iOS devices and more information check here.
The ARCore Depth API enables depth map creation using a single camera without the use of peripheral hardware. The source gets different references to keep the depth textures up to date, retrieves focal length in pixels and transforms a camera-space vertex into world space.
A depth map is created by taking multiple images from different angles and comparing them as phone is moved and estimating the distance to every pixel. This depth-map determines which objects are closer to the player and thus whether a virtual object placed in the environment should appear overlapped by a real-world object.
Download the Unity Editor (this application was developed using 2018.4 (LTS)
Note: If this is your first time using the Unity Editor, install the Unity Hub
Android Build Support
.Android SDK & NDK
Tools and Open JDK
.PC, Mac and Linux Standalone
to Android
Multithreaded Rendering
Gamma
to Linear
Autographics API
Open GLES3
Android 9.0 (Pie)
API level 24 or higherARCore supported
Scene/MainScene
is checked in Scenes in Build queueBuild and Run
application.iOS Build Support
.PC, Mac and Linux Standalone
to iOS
Camera Usage Description
Requires ARKit support
iPhone + iPad
11.0
ARM64
ARKit
for Plug-in ProvidersScene/MainScene
is checked in Scenes in Build queueBuild
application and open .xsproj file in XCode to build.Click here for troubleshooting help. Also refer to the Unity developer documentation
After application start, once scene has been scanned, a phantom domino tile is raycast onto the ground plane to provide a preview of where the domino will appear when the user taps the screen. Players can place multiple domino tiles using this method or can toggle between pre- defined path placement modes in the application’s interface.
There are five different modes of domino path placement:
For the Depth API to work, the user needs to move their phone for a few seconds before occlusion starts working reliably
Optimal range is 1-3 meters (near and far depth estimates are less accurate)
Dynamic objects do not immediately occlude. This adjusts when the scene becomes static
For more information about ARFoundation, check here.
This is not an official Google product, but an AR Experiment developed at the Google Creative Lab. We’ll do our best to support and maintain this experiment but your mileage may vary.
We encourage open sourcing projects as a way of learning from each other. Please respect our and other creators’ rights, including copyright and trademark rights when present, when sharing these works and creating derivative work. If you want more info on Google's policy, you can find that here.
Built by Jasmine Roberts at the Google Creative Lab.