ios - 在 ARSCNView 中禁用实时摄像机源?
问题描述
有什么方法可以禁用实时摄像头馈送并将自定义视频作为 ARSession 中的输入传递?我想通过代码实现Record & Replay ARSession。
解决方案
你去吧:)
var originalSource: if originalSource == nil || scene.background.contents as? UIColor != UIColor.black
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
if originalSource == nil {
originalSource = sceneView.scene.background.contents
sceneView.scene.background.contents = UIColor.black
} else {
sceneView.scene.background.contents = originalSource
}
}
推荐阅读
- json - recaptcha 响应中的前导符号“)]}'”是什么
- python - 在 Mac 上更新 python 版本
- python - KivyMD 与 plyer Filechooser - 如何获取目录的路径?
- ios - 当我在 ios 模拟器上运行我的颤振项目时出现此错误:-ProcessException:进程超时:
- sql - 根据唯一记录 postgres 将一列从一个 sql 表传输到另一列
- c# - Unity Run 功能在按钮单击事件后连续运行
- blazor - Blazor 服务器端应用程序在文件下载后死机
- python - Google OR-Tools - 找到最佳小组作业
- java - com.mongodb.MongoSocketOpenException:异常打开套接字
- javascript - 链式 AJAX 调用在 PHP 脚本中给出“注意:未定义索引”错误