草庐IT

ARFaceAnchor

全部标签

swift - 将 ARFaceAnchor 与 SpriteKit 叠加层对齐

我正在尝试计算特定几何点ARFaceGeometry/ARFaceAnchor上的SpriteKit覆盖内容位置(不仅仅是覆盖视觉内容)。我正在使用计算出的世界坐标中的SCNSceneRenderer.projectPoint,但结果是y反转并且未与相机图像对齐:letvertex4=vector_float4(0,0,0,1)letmodelMatrix=faceAnchor.transformletworld_vertex4=simd_mul(modelMatrix,vertex4)letpt3=SCNVector3(x:Float(world_vertex4.x),y:Float

ios - 如何确定 ARFaceAnchor 是否未在 ARSession 中更新

我有一个应用程序,其中使用了ARSession和ARFaceTrackingConfiguration。每当anchor在session(_session:ARSession,didUpdateanchors:[ARAnchor])中更新时,我都会保存一份anchor的副本。但是当脸部不再出现在画面中时,应用程序无法知道。因为这个函数不会被调用。我已经尝试在session(_session:ARSession,didRemoveanchors:[ARAnchor])中写一个标志,但是没有被调用,因为当脸不再来自时,anchor没有被移除的相机。我使用session的当前帧frame.a