【发布时间】:2025-11-24 12:10:01
【问题描述】:
我有一个循环,在其中更新sceneView 的pointOfView 属性的位置。我很惊讶地看到更新位置后,projectPoint 方法仍然返回相同的值。我错过了什么?
for phi in stride(from: 0, through: 90.0, by: 5) {
for theta in stride(from: 0.0, through: 180.0, by: 5) {
iter += 1
print("Iteration \(iter)")
let pos = sphericalToCartesian(r: 2.0, theta: theta, phi: phi)
let a = SCNVector3(3,4,5)
print("Projecting before updating pointOfView position \(sceneView.projectPoint(a))")
sceneView.pointOfView!.position = pos
print("Projecting after updating pointOfView position \(sceneView.projectPoint(a))")
【问题讨论】:
标签: scenekit