I have an SCNCamera working in a 3D SceneKit view on iOS.
When I change orientation of the screen, in order to keep the world objects the same size and relative positions I need to change the FoV of the SCNCamera.
However, I can't animate this change, so instead the world 'flashes' or 'pulses' as the FoV is changed from one setting to another.
Is there a way of doing this smoothly so that the change in FoV isn't so abrupt that it causes the objects in the world to 'pulse'?
When the device changes orientation, this code is executed:
if UIDevice.current.orientation == .landscapeLeft || UIDevice.current.orientation == .landscapeRight
{
self.cameraNode?.camera?.fieldOfView = 38
}
else
{
self.cameraNode?.camera?.fieldOfView = 50
}
I've tried wrapping the FoV change in a UIView animation block but that didn't work.
I've tried to run it on it's on thread with a delay but that still caused the visual 'pulse' as the FoV changed.
Is there some way to make this transition smooth?