We are using ARKit for detecting horizontal and vertical planes. When user tap somewhere on the screen it get the world coordinates using the hittest function and place 3D object at that specific location. Now what i want is to detect the type of the plane weather the nearest detected plane is vertical or horizontal?
ARKit session configurations are:
let configuration = ARWorldTrackingConfiguration()
configuration.planeDetection = [.vertical, .horizontal]
sceneView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
This is how we are placing 3D objects:
let sceneView = tapGesture.view as! ARSCNView
let location = tapGesture.location(in: sceneView)
let result = sceneView.hitTest(location, types: .existingPlane).first
guard let hitResult = result else {
debugPrint("Unable to get hit result")
return
}
let position = SCNVector3(hitResult.worldTransform.columns.3.x,
hitResult.worldTransform.columns.3.y,
hitResult.worldTransform.columns.3.z)
addNode(position: position)
We are using the Xcode: 9.3 beta