1

I'm trying to remove the default SceneKit camera perspective distortion. I'm building off the default "game" template built into Xcode. The problem I'm having is that there is serious perspective distortion. While this is fine for some applications and games, I want to get rid of it entirely. To show what I mean, here's a screenshot I took from my phone. I placed a plane, and rotated the camera using the white square to pan around. image

Here is what I'm using to create the camera:

cameraNode = [SCNNode node];
cameraNode.camera = [SCNCamera camera];
cameraNode.rotation = SCNVector4Make(0, 1, 0, M_PI);
// cameraNode.camera.xFov = 45.0;
cameraNode.position = SCNVector3Make(0, 0, 0);

[scene.rootNode addChildNode:cameraNode];

As you can see I had tried adjusting the FOV, moving the plane farther back, and making it larger, but that made the box look a lot larger, which made panning around the room take a long time. What's the best method for eliminating or minimizing to the greatest extent the perspective distortion?

Milo
  • 5,041
  • 7
  • 33
  • 59

1 Answers1

6

Looks like what you want is an orthographic projection. You can configure the camera to do this with the property "usesOrthographicProjection" and adjust the viewport with "orthographicScale" on SCNCamera.

If you just want to reduce the distortion but still use a perspective camera, decrease the FOV (and move the camera back to compensate)

Toyos
  • 4,024
  • 15
  • 16
  • Thanks, I had known about orthographic projection, but I missed that in the documentation, I'll definitely try this. – Milo Oct 04 '14 at 06:39
  • @toyos Hello, what is the relationship between viewport and orthographicScale? I'm confuse about that. – ooOlly Sep 20 '18 at 13:37
  • Could you help me out If you have time. My question: https://stackoverflow.com/questions/52428397/confused-about-orthographic-projection-of-camera-in-scenekit – ooOlly Sep 20 '18 at 15:27