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

查看:392
本文介绍了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?

推荐答案

根据这篇文章链接,rootNode的文档说:

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


你不应该修改root的transform属性节点。

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天全站免登陆