ARKit - 仅更新世界坐标原点 [英] ARKit - Update only the world coordinates origin

查看:26
本文介绍了ARKit - 仅更新世界坐标原点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一旦用户扫描了环境并且我检测到了一个平面,我希望世界原点锚点,即应用程序打开时的设备位置(这是 3D 世界的原点),被重置到哪里我的设备现在是正确的,这样用户就可以在他面前看到我的 AR 对象.(我的物体是漂浮的,与地板无关,但检测平面使物体更稳定)

Once the user has scanned the environment and that I detected a plane, I would like the world origin anchor, which is the device position when the app opens (which is the origin of the 3D world), to be reset to where my device is right now so that the user can see my AR objects in front of him. (my objects are floating and not related to the floor but detecting a plane makes the objects more stable)

我没有找到办法做到这一点.它与 ARConfiguration 相关联,但似乎我们无法在不重置所有跟踪的情况下更新坐标系.你有什么想法吗?

I didn't find a way to do that. It's linked to ARConfiguration but it doesn't seem like we can update the coordinate system without resetting all the tracking. Do you have any idea?

推荐答案

根据这篇文章link,rootNode 说:

According to this post link, the documentation of the rootNode says:

您不应修改根节点的变换属性.

You should not modify the transform property of the root node.

我仍然尝试将相机位置影响到 rootNode 的位置,但它没有改变任何东西.因此,似乎唯一的方法是创建一个新节点并将其用作我们所在位置的 rootNode.

I still tried affecting the camera position to the position of the rootNode but it didn't change anything. So it seems like the only way is to create a new node and use it as a rootNode from where we are.

这篇关于ARKit - 仅更新世界坐标原点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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