如何使用手势沿 Y 轴移动 ModelEntity?
按照本文档,我不明白是否有一种简单的移动方法沿 Y 轴的 ModelEntity。我之所以期望如此,是因为在 ARQuickLook 中,此功能与 .scale
和 .rotate
函数一起使用,这些函数也在 Apple 文档中列出。
如果有任何简单/类似的方法来安装这些手势,请告诉我。
Following this documentation, I have not understood if there is an easy way to move a ModelEntity along the Y-axis. The reason I expected this is that in ARQuickLook this functionality works together with the .scale
and .rotate
functions, also listed in the Apple documentation.
If there is any easy/similar way to install these gestures, please let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 RealityKit 2.0 中,与 ARQuickLook 不同,仅实现了单点触摸拖动手势来移动模型(目前尚未实现用于垂直拖动的双指手势)。使用单指手势,您可以沿着其锚定平面移动实体 - 通常是 XZ 平面,因此没有 Y 轴拖动。
尽管如此,您仍然可以选择额外实现 2D UIGestureRecognizer。
(与在 AR Quick Look 应用程序中实现两指平移手势(也称为悬浮手势)的方式相同)
PS
另外,这篇文章将显示您将了解光线投射如何与 RealityKit 手势结合使用。
In RealityKit 2.0, unlike ARQuickLook, only a single touch drag gesture is implemented to move a model (double-finger gesture for vertical drag isn't implemented at the moment). With a single-finger gesture you can move entity along its anchoring plane – as a rule it's XZ plane, so there's no Y-axis drag.
Despite this, you have the option to additionally implement 2D
UIGestureRecognizer
.(The same way you can implement a two-finger pan gesture (also known as levitation gesture) like in AR Quick Look apps)
P. S.
Also, this post will show you how raycasting works in conjunction with RealityKit gestures.