I'm downloading a collada file from a web server and would like to map textures programmatically, but there's SCNGeometry is nil. Can anyone give a suggestion? Below is sample code.
let url = URL(string: "https://s3.amazonaws.com/path/to/dae.dae")!
let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory)
Alamofire.download(
url,
method: .get,
parameters: nil,
encoding: JSONEncoding.default,
headers: nil,
to: destination).downloadProgress(closure: { (progress) in
print(progress)
}).response(completionHandler: { (DefaultDownloadResponse) in
let path = DefaultDownloadResponse.destinationURL
let node = SCNReferenceNode(url: path!)
node?.load()
print(node)
print(node?.geometry)
self.sceneView.scene.rootNode.addChildNode(node!)
})