3 Replies
      Latest reply: Dec 11, 2017 1:49 PM by J27.Kyle RSS
      jesse_j Level 1 Level 1 (0 points)

        As described on the ARSCNView documentation: "The view automatically renders the live video feed from the device camera as the scene background."

         

        Is there a way to programmatically disable/enable this behavior?  For example, if I have an ARKit app using Scenekit and I have added several virtual objects into scene, is these some way to only display the virtual objects with a black background?

        • Re: Disable live video feed in ARSCNView?
          TonyPham Level 2 Level 2 (80 points)

          The bellow code works for me (use touch to on / off):

           

              var originalSource: Any? = nil

              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

                  }

              }