title: Confused about Orthographic Projection of camera in SceneKit
body: <p>I want to use orthographic projection to display 3D scene in my app. In my code I put a box in scene and set orthographic projection of Point of view like blow. Camera at (0,0,500) look at -z direction, and box at origin of world. So camera should be able to capture the box.</p>
  <pre><code>let cameraNode = SCNNode()
  let pov = SCNCamera()
  pov.usesOrthographicProjection = true
  let width = UISreen.main.bounds.size.width
  let glMat = GLKMatrix4MakeOrtho(-width/2, width/2, -width/2, width/2, 1, 1000)
  pov.projectionTransform = SCNMatrix4FromGLKMatrix4(glMat)
  cameraNode.camera = pov
  cameraNode.position = SCNVector3.init(0, 0, 500)
  scene.rootNode.addChildNode(cameraNode)
  
  let boxGeo = SCNBox.init(width: 100, height: 100, length: 1, chamferRadius: 0)
  let box = SCNNode.init(geometry: boxGeo)
  scene.rootNode.addChildNode(box)
  </code></pre>
  <p>But I can see nothing. I find out If set <code>orthographicScale</code> to <code>width/2.0</code> will works correctly.</p>
  <pre><code>pov.orthographicScale = Double(width/2);
  </code></pre>
  <p><strong>Question 1 :</strong> I don't know why this works. I read docs of apple but still confused. <a href="https://developer.apple.com/documentation/scenekit/scncamera/1436612-orthographicscale?language=objc" rel="nofollow noreferrer">https://developer.apple.com/documentation/scenekit/scncamera/1436612-orthographicscale?language=objc</a></p>
  <blockquote>
  <p><strong>orthographicScale</strong></p>
  <p>Specifies the camera’s magnification factor when using an orthographic projection.</p>
  </blockquote>
  <p>Why I need magnify orthographic projection? I already set the dimension of it through <code>GLKMatrix4MakeOrtho</code>.</p>
  <p>I'm not sure whether it is relate to viewport transform? Because viewport transform in OpenGL computed as follows: <a href="https://docs.microsoft.com/en-us/windows/desktop/opengl/glviewport" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/windows/desktop/opengl/glviewport</a></p>
  <p><a href="https://i.stack.imgur.com/JIeZ7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JIeZ7.png" alt="enter image description here" /></a></p>
  <p><strong>Question 2 :</strong> I also find If I create projection matrix like blow it works same as before.</p>
  <pre><code>let glMat = GLKMatrix4MakeOrtho(0, width, 0, width, 1, 1000)
  </code></pre>
  <p>In OpenGL it means different viewing box and will display different partition of scene.</p>
  <p>Any help is appreciated!</p>