问题描述
我想知道是否有人知道是否可以加载 AR 对象(例如从 web url 加载 .usdz 并将其放置在 AR 视图中)。我试过这个:
let fileUrl = NSURL(string: "https://developer.apple.com/augmented-reality/quick-look/models/drummertoy/toy_drummer.usdz")
cancellable = Entity.loadModelAsync(contentsOf: fileUrl! as URL)
.sink(receiveCompletion: { completion in
self.cancellable?.cancel()
},receiveValue: { [self] (model: Entity) in
if let model = model as? ModelEntity {
let anchorEntity = AnchorEntity(anchor: anchor)
anchorEntity.addChild(model)
arView.scene.addAnchor(anchorEntity)
loadingView.isHidden = true
}
})
但它不起作用并抛出错误 Failed to open scene 'https://developer.apple.com/augmented-reality/quick-look/models/drummertoy/toy_drummer.usdz'.
如果可能,你会吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)