【发布时间】:2015-01-03 07:30:18
【问题描述】:
我正在使用 SceneKit 开发一个场景。我有一个带有子节点的主节点:
// Main node
SCNNode* planet = [SCNNode node];
planet.geometry = [SCNSphere sphereWithRadius:2];
planet.position = SCNVector3Make(0, -3, 5);
// sub-node
SCNNode* satellite = [SCNNode node];
satellite.geometry = [SCNSphere sphereWithRadius:0.4];
satellite.position = SCNVector3Make(4, 0, 0);
[planet addChildNode:satellite];
[scene.rootNode addChildNode:planet];
我使用 NSTimer 来制作一些动作和一些动画。在计时器事件中,我这样做:
行星旋转 += 0.1; planet.rotation = SCNVector4Make(0,1,0, planetRotation);
但如果我尝试获取卫星节点的位置,我总是会得到相同的值。 我试图让 positionnode 知道卫星节点的真实位置,但没有任何变化。
更改父节点的旋转时如何获取子节点的真实位置?
提前致谢
【问题讨论】:
标签: objective-c scenekit