My current code base provides the orientation (pitch
, yaw
, roll
) of an ARImageAnchor
in relation to the world. What I want to achieve is to get the ARImageAnchor
orientation data in relation to a node that has been added sometime after starting the session.
func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode,
for anchor: ARAnchor) {
guard let _ = anchor as? ARImageAnchor else { return }
DispatchQueue.main.async {
let cylinderNode = SCNNode()
cylinderNode.geometry = SCNCylinder(radius: 0.05, height: 0.4)
node.addChildNode(cylinderNode)
let ea: SCNVector3 = node.eulerAngles
print(self.convert(ea.x), self.convert(ea.y), self.convert(ea.z))
}
}
Any help would be much appreciated!