I wonder how to get the coordinates of a SCNNode in respect to the Device Reference (and not in respect to the World Reference)?
Thanks!
I wonder how to get the coordinates of a SCNNode in respect to the Device Reference (and not in respect to the World Reference)?
Thanks!
An option could be to get the position of the ARCamera node. You could do this by looping through all the child nodes until you find the ARCamera (or possibly using the ARSCNView's pointOfView method, not sure about this one).
Once you find the camera you can store it into a SCNNode type variable, then you would basically need to get the difference in positions between the two. You could do something like:
SCNVector3Make(cameraNode.x - targetNode.x,
cameraNode.y - targetNode.y,
cameraNode.z - targetNode.z);