title: Scene not rendering properly in SceneKit
body: <p>I created a floor in a scene and loaded a collada file(.dae) into my scene and tried to create a plane below that model. But I have problems like below.</p>
  
  <p><a href="https://i.stack.imgur.com/WVzgQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WVzgQ.jpg" alt="enter image description here"></a></p>
  
  <p>This problem generates only when custom camera is used. Scene renders properly when system camera is used i.e if no custom camera is added
  My code is as below:</p>
  
  <blockquote>
  <pre><code>import UIKit import SceneKit
  
  class TestVC: UIViewController, SCNSceneRendererDelegate {
  
  var cameraNode: SCNNode!
  var modelNode: SCNNode!
  var scnView: SCNView!
  var camNode: SCNNode!
  
  var cameraPosition: SCNVector3!
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      scnView = SCNView(frame: self.view.frame)
      scnView.delegate = self
      view.addSubview(scnView)
      scnView.delegate = self
  
      let scene = SCNScene()
      scnView.scene = scene
  
      //camera
      let camera = SCNCamera()
      cameraNode = SCNNode()
      cameraNode.camera = camera
      camera.zFar = 1000
      cameraPosition = SCNVector3(0, 100, 150)
      cameraNode.position = cameraPosition
      scene.rootNode.addChildNode(cameraNode)
  
      //floor
      let floor = SCNFloor()
      floor.reflectivity = 0
      let floorNode = SCNNode(geometry: floor)
      let firstmaterial = SCNMaterial()
      firstmaterial.diffuse.contents = UIImage(named: "art.scnassets/grass.jpg")
      firstmaterial.diffuse.wrapS = SCNWrapMode.Repeat
      firstmaterial.diffuse.wrapT = SCNWrapMode.Repeat
      floor.materials = [firstmaterial]
      scene.rootNode.addChildNode(floorNode)
  
      let light = SCNLight()
      let lightNode = SCNNode()
      lightNode.light = light
      light.type = SCNLightTypeAmbient
      light.color = UIColor.darkGrayColor()
      scene.rootNode.addChildNode(lightNode)
  
      let light1 = SCNLight()
      let light1Node = SCNNode()
      light1Node.light = light1
      light1Node.position = SCNVector3(0, 200, -100)
      light1.type = SCNLightTypeOmni
      scene.rootNode.addChildNode(light1Node)
  
      let modelScene = SCNScene(named: "Barcelona Chair.dae")
      let solNode = modelScene?.rootNode
      solNode?.eulerAngles = SCNVector3(GLKMathDegreesToRadians(-90), 0, 0)
      scene.rootNode.addChildNode(solNode!)
      scnView.allowsCameraControl = true
  
      let plane = SCNPlane(width: 100, height: 100)
      let planeNode = SCNNode(geometry: plane)
      planeNode.pivot = SCNMatrix4MakeRotation(Float(M_PI_2), 1, 0, 0)//(CGFloat(M_PI_2), 1, 0, 0)
      planeNode.position = SCNVector3(0, 1, 0)
      plane.firstMaterial?.diffuse.contents = UIColor.redColor()
      scene.rootNode.addChildNode(planeNode)
  
  }
  </code></pre>
  </blockquote>