ARKit相机空间的方向是什么? [英] What is the orientation of ARKit's camera space?

查看:66
本文介绍了ARKit相机空间的方向是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更好地了解ARKit的ARCamera转换中的相机坐标空间.

这就是我如何描绘",即x轴始终沿设备的长轴指向,从前置摄像头指向主页"按钮" :

感谢您的帮助,谢谢!

更新:不会影响这个问题,但是要弄清楚一点,我问这个原因是因为我有兴趣从

好的,所以我的初始图是不正确的,正如@ Mart10正确指出的那样.在ARKit Camera上下文中的横向显示意味着手机处于横向显示,并且右侧的主页按钮.这篇文章对此进行了更详细的解释.

这表示相机坐标系的约定是:在横向时,带有Home键的右侧:+ x:右,+ y:上,+ z:向后.

这与传感器坐标系"不同,后者是 x,来自y,y和z的地磁数据值..传感器坐标系"位于横向时,带有Home键的右侧:+ x:向上,+ y:左侧,+ z:向后.您可以使用变换在它们之间切换.

I want to better understand the camera coordinate space that In ARKit's ARCamera tranform is in. In the documentation, it says

This transform creates a local coordinate space for the camera that is constant with respect to device orientation. In camera space, the x-axis points to the right when the device is in UIDeviceOrientation.landscapeRight orientation—that is, the x-axis always points along the long axis of the device, from the front-facing camera toward the Home button. The y-axis points upward (with respect to UIDeviceOrientation.landscapeRight orientation), and the z-axis points away from the device on the screen side.

Following this, the UIDeviceOrientation.landscapeRight documentation says:

The device is in landscape mode, with the device held upright and the home button on the left side.

When I try to understand this, it seems like there is a conflict between "the x-axis points to the right when the device is in UIDeviceOrientation.landscapeRight orientation" and "that is, the x-axis always points along the long axis of the device, from the front-facing camera toward the Home button". The former has +x to the right, and the latter has +x to the left.

Here is how I picture "the x-axis points to the right when the device is in UIDeviceOrientation.landscapeRight orientation":

And this is how I picture "that is, the x-axis always points along the long axis of the device, from the front-facing camera toward the Home button":

Appreciate any help, thanks!

Update: It doesn't impact this question, but to make it more clear, the reason I am asking this is because I am interested in getting the x, y, and z geomagnetic data values from Core Location. In Core Location, if the phone is in Portrait mode, +x is right, +y is up, and +z is towards the user. So it would seem the camera coordinate system for ARKit is different than the camera coordinate system in Core Location.

解决方案

Okay, so my initial diagrams were incorrect, as @Mart10 correctly pointed out. Landscape right in the ARKit Camera context means the phone is in landscape with the home button on the right side. This post explains this in greater detail.

This means the camera coordinate system convention is, when in landscape with the home button on the right side: +x: right, +y: up, +z: backward.

This is different from the "sensor coordinate system", which is the coordinate system that the x, y, and z geomagnetic data values from Core Location come in. The "sensor coordinate system" is, when in landscape with the home button on the right side: +x: up, +y: left, +z: backward. You can use a transform to go between them.

这篇关于ARKit相机空间的方向是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆