0
votes

I am trying to move a node relative to a face, so if the user face move right a diamond shape should move right exactly the same x. I have done it perfectly using ARFaceTrackingConfiguration. However, If there is a big distance between iPhone & the face the renderer delegate method does not fire anymore.

So I guess ARFaceTrackingConfiguration is not meant to be used on long distances because it uses depth sensors which apparently doesn't support that.

So my question is, does ARKit support adding nodes relative to an physical object and when this object moves, it would update me with the position of this object so that I can update the node?

1

1 Answers

1
votes

You seem to have answered your own question.

Yes, with ARKit (and the scene graph / renderer APIs of your choice, such as SceneKit), you can place virtual content such that it moves with the tracked face. In ARSCNView, all you need to do is assign that content as a child of the node you get from renderer(_:didAdd:for:) — SceneKit automatically takes care of moving the node whenever ARKit reports that the face has moved.

If ARKit cannot track the face because it's outside the usable range of the TrueDepth camera… then it's not tracking the face. (Welcome to tautology club.) That means it doesn't know where the face is, can't tell you how the face is moving, and thus can't automatically move virtual content to follow the face.