I am developing an iOS application in Objective-C, I need to apply on a detected face( using google vision's system) a .scn file. After set up a SceneView with a 3D object stored in a Node... I need to a apply it to a face:
SCNVector3 currentPosition = [self.currentView unprojectPoint:(SCNVector3Make(newLeftEyePosition.x, newLeftEyePosition.y , ?))];
self.ship.position = currentPosition;
The problem is the '?', because the value I put as parameter, should be calculated using the distance between the user's face and the device... but how should I get it ? an is what I am trying to do correct, or there is anything wrong in the reasoning?