Ground Detection with ARKit

Hello friends, in this article, we will talk about how we detect the ground with ARKit and how we add a model when we detect the ground. As you know, ARKit is used in many different ways and for many different purposes. One of these purposes is to detect the floor on which the user is walking. For this we can easily detect it with Swift ARKit and add a field here. You can find the articles we created with ARKit here.

In the sample project we will do, when we detect the ground, we will put a picture of lava. Let’s put a SceneKit on our screen, as in the designs we made before, and then we can start writing code.

We need to give a configuration to the SceneView that we have created. While giving the configuration, we should set the horizontal part to the plane detection part. In this way, when Apple’s API finds a horizontal space, it will fall into the didAdd method. When it comes to this method, we add an image consisting of lava as a node.

There are also functions that show how to delete and update in the example below. You can find the latest version of the project here.

If you have questions, you can reach us by sending an e-mail or comment. Good work.


Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.