我已将 3d 对象添加到 dae 格式的场景视图场景中。但它随着相机移动。如何将其固定到特定位置。相同的代码适用于其他 3d 对象,但问题仅与此特定对象有关。下面是使用的代码:
let scene = SCNScene(named: "Volvo_FE_Crane_2013.dae")!
craneNode = SCNNode()
let truckNode = scene.rootNode.childNode(withName: "Volvo_FE_Crane_2013", recursively: true)!
craneNode.addChildNode(truckNode.clone())
craneNode.position = SCNVector3Make(hitResult.worldTransform.columns.3.x, hitResult.worldTransform.columns.3.y, hitResult.worldTransform.columns.3.z)
craneNode.light?.intensity = 1000
craneNode.scale = SCNVector3Make(0.08, 0.08, 0.08)
sceneView?.scene.rootNode.addChildNode(craneNode)