当前在使用arkit时,我尝试在arkit
节点内缩放对象时遇到了一个大问题
extension RecordPlaceViewController: ARSCNViewDelegate {
func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? {
if anchor.name == "test" {
let sceneModel = SCNScene(named: "assetsmodels.scnassets/phone2.scn")
let nodeModel = sceneModel!.rootNode.childNode(withName: "Plane", recursively: true)
nodeModel?.geometry?.firstMaterial?.diffuse.contents = UIImage(named: "uv2")
nodeModel?.scale = SCNVector3(0.1,0.1,0.1)
nodeModel?.eulerAngles.x = -90
return nodeModel
}
return nil
}
}
为什么这两个功能在这里不起作用?
nodeModel?.scale = SCNVector3(0.1,0.1,0.1)
nodeModel?.eulerAngles.x = -90
如果我仅使用scnkit
添加那些元素,但是如果我使用arkit
节点...比例和位置则什么都不做。