ARKIT无法在渲染方法中缩放或旋转

时间:2019-03-08 21:24:26

标签: swift arkit

当前在使用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节点...比例和位置则什么都不做。

0 个答案:

没有答案