Setting ARKit Orientation (Swift)

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

ARKit is set to landscape by default, but I couldn't find any documentation or examples for rotating to portrait. The SceneKit example works in portrait, but the Metal example only works in landscape.

Can ARKit Tracking Orientation be changed?

+3


source to share


2 answers


I was able to solve this in my application logic by multiplying the camera matrix by a quaternion that rotates based on the orientation of the device.



0


source


Currently, iOS 11 Beta

only horizontal detection surfaces are tracked .

Plane detection is disabled by default. If you enable horizontal plane detection, the session adds ARPlaneAnchor objects and notifies you with an ARSessionDelegate, ARSCNViewDelegate, or ARSKViewDelegate object whenever its analysis of captured video images detects an area that appears to be a flat surface.



If you need vertical tracking, do it yourself with the hitTest (_: types :) function . This allows you to inspect surfaces or objects in the real world.

Hit Testing: Finding real world objects or surfaces through AR session processing of the camera image. 2D point in image coordinates can refer to any point along a 3D line that starts with the device camera and continues in a direction determined by the device's orientation and camera projection. This method searches along this line, returning all objects that intersect it in order of distance from the camera.

-1


source







All Articles