load a collada (dae) file into SCNNode (Swift - SceneKit)

后端 未结 4 1550
暖寄归人
暖寄归人 2021-01-05 04:47

This works

let scene = SCNScene(named: \"house.dae\")

Is there an equivalent for a node?

let node = SCNNode(geometry: SCNGe         


        
4条回答
  •  时光说笑
    2021-01-05 05:22

    // add a SCNScene as childNode to another SCNScene (in this case to scene)
    func addSceneToScene() {
        let geoScene = SCNScene(named: "art.scnassets/ball.dae")
        scene.rootNode.addChildNode(geoScene.rootNode.childNodeWithName("Ball", recursively: true))
    }
    addSceneToScene()
    

提交回复
热议问题