Posts

Post not yet marked as solved
1 Replies
1.2k Views
Has anyone been able to get this to work? I've been running Apple's own example code and it seems to fail as well. We're using an iPad mini 5th gen. Here is the code that we're working with: override func viewDidLoad() { super.viewDidLoad() guard let configuration = self.arView.session.configuration as? ARWorldTrackingConfiguration, ARWorldTrackingConfiguration.supportsFrameSemantics(.personSegmentation) else { print("Failed to create config") return } configuration.frameSemantics.insert(.personSegmentation) self.arView.session.run(configuration) } @IBAction func userDidTapToPlaceGlobe(_ sender: Any) { let anchor = AnchorEntity(plane: .horizontal, minimumBounds: [0.15, 0.15]) arView.scene.anchors.append(anchor) guard let url = Bundle.main.url(forResource: "earth", withExtension: "usdz") else { return } _ = ModelEntity.loadModelAsync(contentsOf: url) .sink(receiveValue: { (entity) in anchor.children.append(entity) entity.scale = [1,1,1] * 0.05 entity.generateCollisionShapes(recursive: true) self.arView.installGestures([.translation, .scale, .rotation], for: entity) }) }
Posted
by jjustind.
Last updated
.