With no code to handle rotations or alter anything, when my device is rotated from portrait to landscape the model loaded and centred in a SceneKit view changes perspective, zoom and stretches.
The ViewController has a SceneKit View that is fixed to the top, bottom and sides of the parent view. This is confirmed to adhere even upon rotation.
The devices required are iPhone SE up to 12.9 iPad Pro.
On iPad this visual problem is greatly reduced but on iPhone the distortion and scaling and perspective changes are astonishingly apparent.
I don't know how to embed photos otherwise I'd show you but if the model is front and centre and 1 inch by 1 inch square on portrait iPhone, when you rotate to landscape it becomes 0.25 inch vertical at 0.5 inch horizontal.
Here's the code setting up the scene.
let scene = SCNScene()
let shipScene = SCNScene(named: "merchant.scn")
guard let shipNode = shipScene?.rootNode.childNode(withName: "merchant", recursively: true)
else
{
fatalError("ShipModel is not found!")
}
self.shipNode = shipNode
self.shipNode?.position = SCNVector3(x:0, y:0, z:0)
scene.rootNode.addChildNode(self.shipNode!)
let lightNode = SCNNode()
lightNode.light = SCNLight()
lightNode.light?.type = .omni
lightNode.position = SCNVector3(x:0, y:2, z:10)
let cameraNode = SCNNode()
self.cameraNode = cameraNode
self.cameraNode?.camera = SCNCamera()
self.cameraNode?.position = SCNVector3(x:0, y:0, z:8)
self.cameraNode?.addChildNode(lightNode)
scene.rootNode.addChildNode(self.cameraNode!)
self.sceneKitView?.scene = scene
self.sceneKitView?.showsStatistics = false
self.sceneKitView?.backgroundColor = #colorLiteral(red: 0.08822073042, green: 0.08822073042, blue: 0.08822073042, alpha: 1)
self.sceneKitView?.allowsCameraControl = false
NOTHING else is happening in the class, but the stretching, zooming out and perspective changes happen on device rotation.
They are worse on iPhone but greatly reduced on iPad.