Search code examples
swiftopengl-esscenekitaugmented-realityarkit

Setting ARKit Orientation via Swift


I am developing an ARKit app with OpenGL, so working directly with ARKit and not using SceneKit.

By default, ARKit is set to landscape orientation, but I have been unable to track down any documentation or examples to rotate to portrait. SceneKit example works in portrait but the Metal example only works in landscape.

Is it possible to change the ARKit tracking orientation?


Solution

  • I was able to solve this in the application logic by multiplying the camera matrix by a quaternion that is rotated based on device orientation.