Contents

focalLength

The camera’s focal length, in millimeters.

Declaration

var focalLength: CGFloat { get set }

Discussion

The sensorHeight and focalLength properties determine the camera’s horizontal and vertical viewing angles using terms that model physical camera devices. (Alternatively, you can work with viewing angle directly though the fieldOfView property.) For example, with the default sensor height of 24 mm and default focal length of 50 mm, the vertical field of view is 60°.

Setting the fieldOfView property causes SceneKit to automatically recalculate the focalLength value, and setting the sensorHeight or focalLength property recalculates fieldOfView.

See Also

Managing Field of View