Kyzyl Monteiro
Kyzyl Monteiro

Reputation: 71

Is there ObjectTracking in RealityKit or SceneKit?

I tried out object detection in SceneKit but the object is only detected in the beginning once virtual objects are placed the object is no longer detected or tracked. I remember reading that object detection is not a continuous process but can not find that resource anymore. Please share resources that might be useful. Thank you.

Upvotes: 0

Views: 760

Answers (1)

Marcel Alves
Marcel Alves

Reputation: 496

Update:

ARKit 4 introduces two new types that conform to ARTrackable (ARAppClipCodeAnchor, and ARGeoAnchor), but no changes in ARObjectAnchor.

Also, while I was researching a little more about the subject, I found that Vision framework provides object tracking. This might be useful in some situations.


First, I will try to clarify some concepts.

SceneKit is a rendering framework, so its work is to render virtual objects on the screen.

RealityKit is also a rendering framework. This one was created by Apple to help developers in creating better AR experiences.

That said, rendering frameworks don't actually track anything in the real environment, like physical objects or images. The responsible for understanding the real world is ARKit. ARKit can detect real objects, images, etc., in the physical world.

Going back to your question, in order to be tracked, the physical object should have a correspondent anchor (ARAnchor) in your app that conforms to ARTrackable. As you can see in the documentation, the conforming types of ARTrackable are ARBodyAnchor, ARFaceAnchor, and ARImageAnchor. Object anchors are of the type ARObjectAnchor, and, as you can see in the docs, this class doesn't conform to ARTrackable, meaning that physical objects can't be tracked on ARKit 3.0. ARKit only detects the object, but doesn't track it. In the future, object tracking might be supported.

Upvotes: 2

Related Questions