A demonstration of vertical planes "tracking" and occlusions with ARKit+Scenekit

Overview

arkit-occlusion-demo

Bjarne Lundgren / [email protected] / @bjarnel

This ARKit+SceneKit project shows how to "track" vertical planes (relative to horizontal planes anyway), and how to occlude objects with real world geometry. There is no cheating or magic in this app, this stuff is not really possible with (the current version of) ARKit out of the box - basically you need to tell the app about where the walls/real world geometry is. THEN the app sets up the appropriate masking planes and physics bodies. This is then used to bounce balls of the walls as well as occluding them.

This requires, Xcode 9, iOS 11 and a relatively recent iOS device.

You can pretty much do want you want with the code, but please provide attribution, also if you use it to create a video.

Unedited gameplay video (youtube):

ARKit occlusion demo original video

Screenshots (click for bigger version):

First mapping the real world geometry Throwing beachballs, that bounces of the walls and are occluded by other walls

License

Copyright 2017 Bjarne Lundgren

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

You might also like...
ARKit + CoreLocation: Combines the high accuracy of AR with the scale of GPS data.
ARKit + CoreLocation: Combines the high accuracy of AR with the scale of GPS data.

ARKit: Uses camera and motion data to map out the local world as you move around. CoreLocation: Uses wifi and GPS data to determine your global locati

ARKit Demo Application
ARKit Demo Application

ARKitNavigationDemo Work in progress. In Progress Region β€” For one, we could render far fewer nodes. In fact, it’s a bit distracting that the entire t

IOS example app to generate point clouds in ARKit using scenedepth
IOS example app to generate point clouds in ARKit using scenedepth

Visualizing a Point Cloud Using Scene Depth Place points in the real-world using the scene's depth data to visualize the shape of the physical environ

ARKit Base Project. Place virtual objects based on WWDC example project
ARKit Base Project. Place virtual objects based on WWDC example project

ARKit - Placing Virtual Objects in Augmented Reality Learn best practices for visual feedback, gesture interactions, and realistic rendering in AR exp

PlacenoteSDK Sample app in native iOS using ARKit, written primarily in Swift

Placenote SDK for iOS Placenote SDK lets you easily build cloud-based Augmented Reality (AR) apps that pin digital content to locations in the real wo

Power! Unlimited power for ARKit 2.0!
Power! Unlimited power for ARKit 2.0!

A long time ago in a galaxy, far, far away... It is a period when iPhone SE and iPhone X were destroyed from the apple store, the AR market was under

A simple application created for educational purposes for mastering ARKit
A simple application created for educational purposes for mastering ARKit

ARDrawing AR Drawing is a simple application created for educational purposes for mastering ARKit. The basis of the project is copied from the project

Trying TDD with ARKit
Trying TDD with ARKit

ARPlacer BDD Spec As a user I want to place a random object in real world. I also want to see the distance between AR object and my phone. Use Cases

Draw VR content over live camera feed with ARKit

funny-ar Exercise with ARKit: draw VR content over live camera feed: work is in

Comments
  • Wall Node

    Wall Node

    As you have mentioned already in WallNode.swift.

      node.eulerAngles = SCNVector3(0,
                                          -atan2(to.x - node.position.x, from.z - node.position.z) - Float.pi * 0.5,
                                          0)
    
     // orientation of the wall is fairly simple. we only need to orient it around the y axis,
            // and the angle is calculated with 2d math.. now this calculation does not factor in the position of the
            // camera, and so if you move the cursor right relative to the starting position the
            // wall will be oriented away from the camera (in this app the wall material is set as double sided so you will not notice)
            // - obviously if you want to render something on the walls, this issue will need to be resolved
    ```.
            
    I am facing the same issue. rendering into wall is flipped can you suggest a solution I am not able to figure it out 
    opened by PrashantKT 0
  • App does nothing

    App does nothing

    I'm sorry but I just built the app but it does nothing. I can tap the "new wall" but when I walk around there is no interaction whatsoever. Maybe I am using it the wrong way.

    I built it on the latest Xcode 9 I have iphone 6s with latest iOS 11

    opened by neutrum 0
  • Not reading my touch, when pressing start new wall.

    Not reading my touch, when pressing start new wall.

    Hello, I downloaded this repo and tried running it on my iphone device. Looks like when i press the new wall button it stays at a blank camera screen and doesn't do anything when i touch to set the new wall.

    opened by SebastainMisas 2
Owner
Bjarne Lundgren
Software Engineer @ TV 2 DANMARK A/S. Mostly working with iOS development and streaming apps. 99% of all my GitHub activity is in private repositories.
Bjarne Lundgren
AR Ruler - A simple iOS app made using ARKit and SceneKit

A simple iOS app made using ARKit and SceneKit.Which can try to simplify little things in your life such as measuring stuff.

Dishant Nagpal 5 Aug 31, 2022
A library that allows you to generate and update environment maps in real-time using the camera feed and ARKit's tracking capabilities.

ARKitEnvironmentMapper Example To run the example project, clone the repo, and run pod install from the Example directory first. Installation ARKitEnv

SV Hawks 91 Dec 4, 2022
A library that allows you to generate and update environment maps in real-time using the camera feed and ARKit's tracking capabilities.

ARKitEnvironmentMapper Example To run the example project, clone the repo, and run pod install from the Example directory first. Installation ARKitEnv

SV Hawks 91 Dec 4, 2022
Augmented Reality image tracking with SwiftUI, RealityKit and ARKit 4.

ARImageTracking This is an Augmented Reality Xcode project that uses Apple's newest RealityKit framework and ARKit 4 features, to dynamically track a

Richard Qi 198 Dec 7, 2022
This library uses ARKit Face Tracking in order to catch user's smile.

SmileToUnlock Make your users smile before opening the app :) Gif with the demonstration Installation Cocoapods The most preferable way to use this li

Ruslan Serebriakov 628 Oct 22, 2022
ARVoxelKit - Lightweight Framework for Voxel graphic using AR + SceneKit

ARVoxelKit Lightweight Framework for Voxel graphic using AR + SceneKit Requirements ARVoxelKit requires iOS 11 and devices, which support ARKit Usage

null 79 Dec 29, 2022
Swift framework for loading various 3d models in SceneKit

AssetImportKit AssetImportKit is a cross platform library (macOS, iOS) that coverts the files supported by Assimp to SceneKit scenes. Features AssetIm

eugene 74 Nov 30, 2022
Caffeine tracking for everyone

Cortado Cortado is an iPhone app to help you track your caffeine consumption habits. Besides letting you manually enter caffeine data, it detects when

Emilia 169 Oct 16, 2022
Using ARKit and LiDAR to save depth data and export point cloud, based on WWDC20-10611 sample code

Save iOS ARFrame and Point Cloud This project improves the usability of the sample code from WWDC20 session 10611: Explore ARKit 4. Note that the samp

null 4 Dec 22, 2022
An iOS Framework Capture & record ARKit videos πŸ“Ή, photos πŸŒ„, Live Photos πŸŽ‡, and GIFs πŸŽ†.

An iOS Framework that enables developers to capture videos ?? , photos ?? , Live Photos ?? , and GIFs ?? with ARKit content.

Ahmed Bekhit 1.5k Dec 24, 2022