【问题标题】:how to go from back to front camera on arkit如何在arkit上从后到前摄像头
【发布时间】:2018-09-14 03:34:09
【问题描述】:

此代码只是一个简单的 arkit。在按钮中,我希望用户单击以在后置摄像头上看到 arkit 和前置摄像头之间来回切换。

let configuration = ARWorldTrackingConfiguration()
let augmentedRealitySession = ARSession()

override func viewDidAppear(_ animated: Bool) {
    augmentedRealityView.session.run(configuration)

    augmentedRealityView.automaticallyUpdatesLighting = true
}

@IBAction func place(_ sender: Any) {
}

【问题讨论】:

    标签: ios swift camera arkit


    【解决方案1】:

    ARKit 世界追踪不支持前置摄像头,因此无法切换到它。

    ARKit 人脸追踪支持前置摄像头,但是...

    • 它根本不像世界跟踪那样工作——没有平面检测、没有世界坐标系、没有命中测试等——因此切换配置会完全改变您的 AR 体验行为。
    • 它需要原深感摄像头,因此只能在 iPhone X 上使用。

    【讨论】:

      猜你喜欢
      • 2018-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-25
      • 1970-01-01
      • 2016-03-06
      • 2020-07-23
      相关资源
      最近更新 更多