How do you load a .dae file into an SCNNode in iOS SceneKit?

前端 未结 6 1176
你的背包
你的背包 2021-01-31 10:14

I am having trouble understanding how geometry from .dae files should be loaded into an iOS SceneKit scene graph.

I know that you can load .dae

6条回答
  •  礼貌的吻别
    2021-01-31 11:03

    guard let shipScene = SCNScene(named: "ship.dae") else { return }
    let shipNode = SCNNode()
    let shipSceneChildNodes = shipScene.rootNode.childNodes
    for childNode in shipSceneChildNodes {
        shipNode.addChildNode(childNode)
    }
    

提交回复
热议问题