Importing .scn file to scene from URL with textures

久未见 提交于 2019-12-03 15:36:13

You should download the file along with its textures, and then load the scene. Note that the .scn file and the textures should be in the same directory unless you want to add some loading options.

After downloading a .scn file with a texture from the server, I used this code to display the object:

do {
        let scene = try SCNScene(url: URL(fileURLWithPath: "YourDownloadedScnFilePath") , options: nil)

        // Set the scene to the view
        sceneView.scene = scene
    } catch {
        print("ERROR loading scene")
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!