Depth illusion by 3D head tracking and off-axis projection on iPhoneX
Uses Unity, UnityARKitPlugin and Xcode 9.2
Project made in Unity 2017.3.0f3
Note that this is a monoscopic effect. When using the app IRL, the illusion is best seen with ONE EYE - the other eye closed. (Also works great for video since video is monoscopic). For a stereo effect some type of glasses would be needed (anaglyph or active) and the app adapted for it.
Info on method and code: TheParallaxView Article
Detailed Build Instructions
- Clone or download the repository
- Make sure you have the ARKitPlugin folder already on your computer. If not, open Unity and get it from the Asset Store. (This step cannot be done after opening TheParallaxView because that will overwrite the project settings when importing it). If it’s the first time using ARKitPlugin, make sure you can build the Face Tracking examples and run them on the device.
- Copy the ARKitPlugin folder into TheParallaxView/Assets
- Start Unity and open the TheParallaxView
- Check "ARKit uses Face Tracking" checkbox in Assets/UnityARKitPlugin/Resources/UnityARKitPlugin/ARKitSettings.asset
- Double-click the HeadTrack3D scene
- To see a good preview, set Game view to 2436 x 1125 pixels (which is iPhone Landscape resolution)
- File>Build Settings - select iOS and hit “Switch Platform”
- Click “Player Settings” and under “Other Settings”, insert your Apple Developer Signing Team ID (alternatively, select Team ID later on in Xcode)
- Back in the Build Settings, hit “Build”. Create a folder called “Builds”, navigate into it, then choose a name for your build such as “IOS”. Hit Save. Now an Xcode project is generated by Unity.
- Start Xcode 9.2 and open Unity-iPhone.xcodeproj that was created in the last step and hit Run.