Can't display 3d file from cache directory

无人久伴 提交于 2019-12-05 20:53:14
rob mayoff

The SCNSceneSource Class Reference has a table:

Format                          Filename Extension    Supported in

Collada Digital Asset Exchange  .dae                  OS X v10.8 and later

Alembic                         .abc                  OS X v10.10 and later

SceneKit compressed scene       .dae or .abc          OS X v10.10 and later
                                                      iOS 8.0 and later

SceneKit archive                .scn                  OS X v10.10 and later
                                                      iOS 8.0 and later

Are you sure your .dae file is a “SceneKit compressed scene”? Apparently, iOS only supports loading compressed scenes from .dae files. Xcode should automatically convert your Collada .dae to a compressed scene (with the same extension) when it compiles your app. If you're loading the file from outside your app bundle (e.g. from a URL at runtime), it won't be a SceneKit compressed scene unless you've taken steps to convert it elsewhere.

I found the following comment on this answer:

To convert the dae file to a file that can be read by SCNScene(named:... you can convert the file manually by using the following commandline in terminal: /Applications/Xcode.app/Contents/Developer/usr/bin/scntool --convert InFile.dae --format c3d --output OutFile.dae --force-y-up --force-interleaved --look-for-pvrtc-image (Of course, replace InFile.dae and OutFile.dae by your own filenames) Sorry, no real formatting possible in comments. – Marcus Feb 2 at 18:23

I don't know if all those flags are appropriate for your use. According to this web site, there's also a command-line program named copySceneKitAssets (in the same Xcode subdirectory) that converts .scnassets directories, so maybe that's what you want to use.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!