草庐IT

hitTransform

全部标签

ios - 如何使用 ARKit 将 SCNNode 的方向更改为相机

下面的代码将SCNPlane放置在触摸点上,但该平面定向(旋转)到应用程序启动时手机所在的位置。理想情况下,我希望将节点定向到物理墙或相机的当前方向。这是如何使用ARKit完成的?overridefunctouchesBegan(_touches:Set,withevent:UIEvent?){guardlettouch=touches.firstelse{return}letresult=sceneView.hitTest(touch.location(in:sceneView),types:[ARHitTestResult.ResultType.featurePoint])guar