Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 208
michaeltheory Avatar asked Dec 06 '25 17:12

michaeltheory


1 Answers

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.

like image 89
michaeltheory Avatar answered Dec 08 '25 22:12

michaeltheory



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!