swift - Reality Composer 默认 anchor

标签 swift augmented-reality arkit realitykit reality-composer

当您使用 Reality Composer 创建任何场景时,您必须首先选择 anchor 的类型“地板、墙壁、面、物体”,这意味着当您加载场景时,它会自动将其自身放置到指定的 anchor 。

enter image description here

我的问题是,有没有办法从代码中手动设置它,以便我可以进行 HitTest ,然后手动将其锚定到特定点?

谢谢。

最佳答案

官方文档没有提到能够在运行时更改默认 anchor ,但从您的描述来看,您似乎可以尝试选择对象锚定以将场景放置在检测到的对象附近,如下所述: https://developer.apple.com/documentation/realitykit/creating_3d_content_with_reality_composer/selecting_an_anchor_for_a_reality_composer_scene

关于swift - Reality Composer 默认 anchor ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58007846/

相关文章:

c++ - OpenGL 中的像素操作

android - 如何获取启用 GPS 的手机的摄像头方向?

swift - iOS RealityKit。更改实体的翻译会导致意外行为

swift - RealityKit – 错误 : 'translation' is inaccessible due to 'internal' protection level

ios - 状态栏在 iPhone X 中没有动画

macos - SWIFT OS X - 从持久存储中删除托管对象 : fatal error

swift - 有没有办法对函数调用进行排队?

ios - ARFaceTracking配置: How to distinguish pictures from real faces?

swift - 如何在 RealityKit 中仅围绕一个轴旋转对象?

ios - 是否可以通过接口(interface)生成器从父类(super class)更改约束的常量值?