Swift SceneKit问题在预览中具有节点位置

发布于 2025-02-13 12:13:16 字数 139 浏览 1 评论 0原文

我正在尝试将节点添加到我的场景视图中,但是所有节点的位置为零,但位置不同。

每个节点都有一个位置(0,0,0),但是在场景视图上,该节点的位置不同。另外,我无法找到节点之间的距离,因为每个节点都有一个位置(0,0,0)。请向我解释我的节点有什么问题。

I'm trying to add nodes to my scene view, but all of the nodes have a zero position, but different placements.

Each node has a position (0,0,0) but, on the scene view, this node has a different placement. Also, I can`t find the distance between nodes because each node has a position (0, 0, 0). Please explain to me what is wrong with my nodes.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凉栀 2025-02-20 12:13:16

如果要获取节点的真实位置,请尝试以下操作:

node.presentation.worldPosition

这应该始终返回屏幕上的节点的有效位置。

If you want to fetch the real position of a node try this:

node.presentation.worldPosition

This should always return you the effective position of the node as seen on screen.

等风也等你 2025-02-20 12:13:16

问题是在3D对象中,3D的原始位置没有集中。我将每个3C对象上传到搅拌器,然后将原始位置更改为(0,0,0)

The problem was in 3d object, the original position of the 3d was not centered. I upload each 3c object to Blender and change original position to (0,0,0)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文