【问题标题】:Disable live camera feed in ARSCNView?在 ARSCNView 中禁用实时摄像机源?
【发布时间】:2021-11-20 23:54:13
【问题描述】:

有什么方法可以禁用实时摄像头馈送并将自定义视频作为 ARSession 中的输入传递? 我想通过代码实现Record & Replay ARSession

【问题讨论】:

    标签: ios scenekit arkit realitykit reality-composer


    【解决方案1】:

    你去吧:)

        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
        
        }
        
        }
    

    【讨论】:

    • 这似乎只是让背景变黑
    • 是的,把背景变黑并将数据重定向为输入
    • var originalSource: if originalSource == nil || scene.background.contents as? UIColor != UIColor.black 甚至无法编译。你的代码真的会重定向输入吗?看起来它只是向用户显示黑色背景,实际上并没有重定向它。
    • 不行,黑色只会改变场景内容的颜色,摄像头会同时工作,我想用录制的视频替换摄像头。
    猜你喜欢
    • 2012-06-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-07
    • 1970-01-01
    • 2019-05-22
    • 1970-01-01
    相关资源
    最近更新 更多