The camera's focal length, in millimeters.
SDKs
- iOS 11.0+
- macOS 10.13+
- Mac Catalyst 13.0+
- tvOS 11.0+
- watchOS 4.0+
Framework
- Scene
Kit
Declaration
var focalLength: CGFloat { get set }
Discussion
The sensor
and focal
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 field
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 field
property causes SceneKit to automatically recalculate the focal
value, and setting the sensor
or focal
property recalculates field
.