本文介绍了在ARKit中创建SCNScene对象时无法加载.dae文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正尝试在以下代码行的帮助下加载.dae文件:
I am trying to load a .dae file with the help of the following line of code:
let scene = SCNScene(named: "art.scnassets/bench.dae")
但是,当我运行项目时,由于可变场景为nil,应用程序崩溃了.
But, when I run my project, the app is crashing because the variable scene is nil.
我在做什么错了?
推荐答案
似乎问题在于.dae文件的大小/方向.我将其旋转了90度,并将图像按比例缩小,现在看来可以正常工作了.
It seems that the problem was with the .dae file's size/orientation. I rotated it by 90 degrees and scaled the image down and it seems to work now.
这篇关于在ARKit中创建SCNScene对象时无法加载.dae文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!