How to get the real position of a sub node in SceneKit after rotation?

前端 未结 2 1248
盖世英雄少女心
盖世英雄少女心 2021-01-11 21:25

I am developing a scene with SceneKit. I have a main node with a subnode:

// Main node
SCNNode* planet = [SCNNode node];
planet.geometry = [SCNSphere sphereW         


        
2条回答
  •  星月不相逢
    2021-01-11 22:11

    The node's position won't change due to physics, that is why you aren't seeing it change. You need to call the node's presentationNode to get the position of the node as it is presented onscreen:

    node.presentationNode.position
    

提交回复
热议问题