Correct "Field of View" for SCNCamera

3.1k Views Asked by At

I'm trying to find out what is the correct value for field of view in scene kit on ipad and iphone. the default value of 60 degree has bad effect on a sphere at edge of screen. the sphere gets elliptical shape. A value of 34 degree causes the skybox to get pixelated. what are the correct values for iPad & iPhone?

_cameraNode = [SCNNode node];
_cameraNode.position = SCNVector3Make(0, 0, 500);

[scene.rootNode addChildNode:_cameraNode];

_cameraNode.camera = [SCNCamera camera];
_cameraNode.camera.automaticallyAdjustsZRange = YES;

#if TARGET_OS_IPHONE
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
    _cameraNode.camera.yFov = 55;

} else #endif {
    _cameraNode.camera.xFov = 34;
}

scnView.pointOfView = _cameraNode;
1

There are 1 best solutions below

0
On BEST ANSWER

FOV doesn't depend on the screen, but rather on the way you want your user to see your scene.

The default for most 3D programs is a 36mm lens, which has roughly a 53° FOV. Lower values will feel zoomed in, higher values zoomed out, with a fisheye lens. There is no magic number and you have to think about how your scene is viewed, then fix the problems that arise.

If your scene is very small, and the viewer big (Sim City for example), a low field of view will look the best.

If your scene is very big, and the viewer small (most games played from a first-person perspective), a high field of view will make the world feel massive.

Try and find which one makes your scene look the correct scale, then fix the problems that arise:

If you choose a low FOV, you will need a higher resolution Skybox. There is no way around it as it's directly linked to the FOV.

If you choose a higher value, anything above 50° will start having distortion. This will be more noticeable on the iPhone due to the wide screen. You can use a shader to improve the distortion. There are a few ways to do lens correction, notably barrel distortion.

There are a few interesting formulas here : http://paulbourke.net/miscellaneous/lenscorrection/