我正在使用以下代码加载Reality Composer场景:
class GalleryViewController: UIViewController {
@IBOutlet var arView: ARView!
override func viewDidLoad() {
super.viewDidLoad()
// Configure the AR session for horizontal plane tracking.
let arConfiguration = ARWorldTrackingConfiguration()
arConfiguration.planeDetection = .horizontal
arView.session.run(arConfiguration)
Experience.loadGalleryAsync {[weak self] result in
switch result {
case .success(let gallery):
guard let self = self else { return }
print("LOADED Gallery")
self.arView.scene.anchors.append(gallery)
case .failure(let error):
print("Unable to load the game with error: \(error.localizedDescription)")
}
}
但是,在显示消息LOADED Gallery
之后出现3D对象,有时根本没有加载图像。
我认为我需要在空间中移动iPhone以加载图像。 我的问题是: