PerspectiveCamera in portrait and landscape modes

I have an ARView in nonAR cameraMode and a PerspectiveCamera. When I rotate my iPhone from portrait to landscape mode, the size of the content shrinks.

For example, the attached image shows the same scenes with the phone in portrait and landscape modes. The blue cube is noticeable smaller in landscape. The size of the cube relative to the vertical space (i.e., the height of the view) in each situation is consistent.

Is there a way to keep the scene (e.g., the cube) the same size whether I am in portrait or landscape mode?

Accepted Reply

I have found a workaround, but I don't know if this a good design or not.

In "Deployment Info" in Xcode, I set iPhone/iPad Orientation to Portrait only. Then when I rotated the device to the side, the cube doesn't change sizes.

(Note: I am getting the device's eulerAngles and converting them to a quaternion and applying that to the PerspectiveCamera)

Replies

I have found a workaround, but I don't know if this a good design or not.

In "Deployment Info" in Xcode, I set iPhone/iPad Orientation to Portrait only. Then when I rotated the device to the side, the cube doesn't change sizes.

(Note: I am getting the device's eulerAngles and converting them to a quaternion and applying that to the PerspectiveCamera)