I need to convert a point in the 2d coordinate space of my ARSCNView
to a coordinate in 3d space. Basically a ray from the point of view to the touched location (up to a set distance away).
I wanted to use arView.unprojectPoint(vec2d)
for that, but the point returned always seems to be located in the center of the view
vec2d
is a SCNVector3
created from a 2d coordinate like this
SCNVector3(x, y, 0) // 0 specifies camera near plane
What am I doing wrong? How do I get the desired result?