如何知道是否必须将USDZ模型放置在检测到的平面上?
我正在开发iOS购物应用程序,并具有AR功能,用户可以使用Arkit&将对象放置在现实世界中。 RealityKit。 我一直在使用苹果的
我有不同种类的AR模型 - 有些应仅放置在水平面上,而有些则只能放置在垂直平面上。
我可以检测水平
/垂直
平面,但不确定如何知道该模型是否支持水平或垂直对齐。 任何答案都非常感谢。 谢谢
I am developing the iOS shopping app and it has the AR feature that users can place the object in the real world using the ARKit & RealityKit.
I have been using Apple's sample AR project for the AR feature and it's been working great with horizontal planes.
I have different kinds of AR models - some should be placed on the horizontal plane only, and some should be placed on the vertical plane only.
I can detect the horizontal
/vertical
planes but not sure how to know if the model supports the horizontal or vertical alignment.
Any answers are highly appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在RealityKit中,使用
.isanchored
找出是否将模型放置在检测到的平面上。在Arkit中,使用
锚点(for:)
实例方法,搜索场景层次结构与所提供的节点关联的锚点。内部ARSCNVIEW委托方法使用以下逻辑:
In RealityKit, use
.isAnchored
to find out whether your model is placed on the detected plane.In ARKit, use
anchor(for:)
instance method that searches the scene hierarchy for an anchor associated with the provided node.Inside ARSCNView delegate method use the following logic: