In a perspective projection, equally sized objects nearer to the camera appear larger than those farther away. Is it possible to affect the distortion of perspective projection? The picture shows what I mean.
The default perspective projection can sometimes result in unrealistic distortion when the camera is near the object and it would be great if I could set some property to modify it. I have my fingers crossed for projectionTransform()
and setProjectionTransform(_:)
but I have no idea how to use them. usesOrthographicProjection
is unfortunately too extreme.
Easy! What you are looking for is the field of view. It's available as a property of the camera and is pretty much equal to the Zoom on its real life counterpart.
A low field of view means your camera is very zoomed in. That way, there will be very little perspective, but you will have to move the camera further back (since you are zooming in).
On the opposite, if you set a high field of view, the camera will be very zoomed out until it starts looking like a GoPro or any "wide angle" camera. There will be a lot of distortion and you'll need to move the camera closer.
Here's a crash course on perspective for virtual cameras. It's about Cinema 4D and they use "Focal Length" instead of field of view, but overall the concept is the same.