Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable live camera feed in ARSCNView?

Is there any way to disable the live camera feed and pass the custom video as input in ARSession? I want to achieve Record & Replay ARSession by code.

like image 925
Saurabh Singh Rathore Avatar asked Nov 06 '22 00:11

Saurabh Singh Rathore


1 Answers

There you go :)

    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
    
    }
    
    }
like image 86
UnkownReality Avatar answered Nov 13 '22 17:11

UnkownReality