【发布时间】:2019-09-06 15:13:52
【问题描述】:
我已经在使用 ARKit 和 SceneKit 检测我的 AR 应用程序中的水平面。
let configuration = ARWorldTrackingConfiguration()
configuration.planeDetection = .horizontal
sceneView.session.run(configuration)
sceneView.delegate = self
这会调用平面检测的委托方法。
func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) {
// 1
guard let planeAnchor = anchor as? ARPlaneAnchor else { return }
// 2
let width = CGFloat(planeAnchor.extent.x)
let height = CGFloat(planeAnchor.extent.z)
let plane = SCNPlane(width: width, height: height)
}
但是有什么方法可以让我获得检测到的平面并以某种方式捕获其图像?
【问题讨论】: