【问题标题】:Swift SceneKit issue with node position on preview预览时节点位置的 Swift SceneKit 问题
【发布时间】:2022-07-07 00:23:40
【问题描述】:

Im 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 cant 求节点之间的距离,因为每个节点都有一个位置 (0, 0, 0)。请向我解释我的节点出了什么问题。

【问题讨论】:

  • 你能展示一些关于你正在写的代码吗?

标签: swift scenekit


【解决方案1】:

如果你想获取节点的真实位置,试试这个:

node.presentation.worldPosition

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

【讨论】:

    猜你喜欢
    • 2014-11-24
    • 1970-01-01
    • 2021-10-11
    • 2017-02-07
    • 2020-06-03
    • 2020-02-22
    • 1970-01-01
    • 2017-12-03
    • 2021-08-25
    相关资源
    最近更新 更多