Load a 3D Model from internet?

Hello. Sorry for my poor english.


I'm a totally noob in 3D. Is it possible to load a Collada (.DAE) model from internet? When I try to load a model previously downloaded from internet (using NSURLSession) I get error, but when I try to load the same .DAE added to my XCODE project I dont get error. I suspect that XCODE converts COLLADA in compilation.


is there any way to load a standard Collada or other 3D Model without be previously converted by XCODE? I want to Load 3D models uploaded for clients to my server.


Thanks

Replies

The Preview application uses Scene Kit to preview Collada files, so it does work on OS X. I also it witnessed it my own apps. I've never heard of Xcode "optimizing" Collada files.


Either it does not work properly on iOS or your downloading code is buggy. Which error do you get, by the way ?

Per the SCNSceneSource documentation at https://developer.apple.com/library/mac/documentation/SceneKit/Reference/SCNSceneSource_Class/ you must run your DAE file through Xcode to load it onto an iOS device from SceneKit. Xcode invokes scntool.


See also http://www.the-nerd.be/2014/11/07/dynamically-load-collada-files-in-scenekit-at-runtime/.

I asked Apple about using On Demand Resources with SceneKit (you could import your DAE files in the project), here is their answer:


"SceneKit scenes, particles and texture atlases are not executable, although they may be binary data. But as such can be included in ODR asset catalogs. In fact, SceneKit encodes its data similarly to SpriteKit, so the allowances for SpriteKit are maintained for SceneKit. Keep in mind, however that a 3D scene may often have references to textures, so it is recommended—but optional—to put scenes and textures together in a SceneKit asset catalog, which is a folder with the “scnasset" extension. Xcode manages these as a folder reference and will assign an ODR tag to the entire asset catalog rather than individual sub-items. You can also choose to have more than one SceneKit asset catalog within your app, so you shouldn’t be limited there."


They also said you can create a new .scnasset folder either by creating a new asset catalog (New > File > Resource) then changing its extension from .xcassets to .scnassets, selecting another file then selecting the .scnassets file again to upate the XCode UI (the renaming part is important, otherwise the On Demand Resource Tags section will be missing:) OR "you could create a folder entitled e.g level2.scnassets directly in the Finder, and just drag that into your project and Xcode will correctly recognize it as a SceneKit asset catalog."