1 Reply
      Latest reply: Feb 9, 2018 4:28 PM by drewster RSS
      TonyPham Level 2 Level 2 (80 points)

        The original sample code runs well on my system. However, after adding few code for light as the following:

         

         

        override func viewDidLoad() {
               ...
                let light = SCNLight()
                light.type = SCNLight.LightType.ambient
                light.color = UIColor(white: 0.67, alpha: 1.0)
                let ambientLightNode = SCNNode()
                ambientLightNode.light = light
                sceneView.scene.rootNode.addChildNode(ambientLightNode)
          }
        

         

         

        the app crashes in function renderer(didAdd:for:) for the line

         

        previewNode?.removeFromParentNode()
        

         

        Any idea? Thanks