I will like to place 2 lines in the bounds of the current camera view as flow:
Source - SceneKit docs
From the ARKit docs, I understand that I need the projectionMatrix, but how can I calculate the diff from "zNear" to "zFar" and x\y?
I'm starting with this code:
let cameraProjectionMatrix = session.currentFrame?.camera.projectionMatrix
let cameraPosition = SCNVector3.positionFromTransform(cameraProjectionMatrix)
let rightBoxNode = SCNNode(geometry: SCNBox(...))
rightBoxNode.position = SCNVector3(???)
sceneView.scene.rootNode.addChildNode(rightBoxNode)
and for the left one i will probably need
var leftPos = rightboxNode.position
leftPos.x = rightboxNode.position.x * -1
leftBoxNode.position = leftPos
But I failed when trying calculating rightboxNode.position:
rightBoxNode.position = SCNVector3(x: x1 ,y: y1 z: zNear)