小编Roy*_*yLi的帖子

如何获取 ARKit 3 动作捕捉中的所有关节 XYZ 坐标

我正在尝试编写获取 ARKit 3 运动捕捉中所有关节 XYZ 坐标的方法,以便让 XYZ 找到身体的所有角度。但我找不到 XYZ 坐标,因此无法执行下一步。

我试图用来character!.jointTransforms获取联合数据翻译,可能是 XYZ 坐标,但我尝试跟踪一些运动,但数字没有改变。

这是我的代码

import UIKit
import RealityKit
import ARKit
import Combine

class ViewController: UIViewController, ARSessionDelegate {

    @IBOutlet var arView: ARView!

    var character: BodyTrackedEntity?
    let characterOffset: SIMD3<Float> = [0.0, 0, 0]
    let characterAnchor = AnchorEntity()

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        arView.session.delegate = self

        guard ARBodyTrackingConfiguration.isSupported else {
            fatalError("This feature is only supported on devices with an A12 chip")
        }

        let configuration = ARBodyTrackingConfiguration()
        arView.session.run(configuration)

        arView.scene.addAnchor(characterAnchor)

        // …
Run Code Online (Sandbox Code Playgroud)

motion-detection swift arkit ios13

5
推荐指数
1
解决办法
858
查看次数

标签 统计

arkit ×1

ios13 ×1

motion-detection ×1

swift ×1