【发布时间】:2020-08-10 16:10:45
【问题描述】:
我检查了以下两个示例代码:https://developer.apple.com/documentation/arkit/capturing_body_motion_in_3d
func session(_ session: ARSession, didUpdate anchors: [ARAnchor])
{
for anchor in anchors
{
guard let bodyAnchor = anchor as? ARBodyAnchor else { continue }
let skeleton = bodyAnchor.skeleton
}
}
和:https://developer.apple.com/documentation/arkit/tracking_and_visualizing_faces
func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor)
{
guard let faceAnchor = anchor as? ARFaceAnchor else { return }
let blendShapes = faceAnchor.blendShapes
}
提取人脸 BlendShape 的代码使用“renderer”来获取 BlendShape 的值。
但是,检测身体运动的代码使用“会话”来获取值。
这两个代码似乎都是为了获取从 ARAnchor 更新的值。
“渲染器”和“会话”有什么区别?
如何在不同时间使用这两个代码?
【问题讨论】:
标签: swift augmented-reality scenekit arkit realitykit