【发布时间】:2020-04-02 02:25:23
【问题描述】:
由于某种原因,即使我在 Stackoverflow 上查看了某人的问题,我也无法让人们使用遮挡。这是我的代码:
//Load ARView
let arView = ARView(frame: .zero)
//Load people occlusion
let session = ARSession()
if let configuration = session.configuration as? ARWorldTrackingConfiguration {
configuration.frameSemantics.insert(.personSegmentationWithDepth)
session.run(configuration)
}
//Load custom model(not in use)
let model = try! Entity.loadModel(named: "Mug")
//Load Anchor + Entity
let anchor = AnchorEntity(plane: .horizontal)
let box = MeshResource.generateBox(size: 0.1)
let material = SimpleMaterial(color: .red, isMetallic: true)
let entity = ModelEntity(mesh: box, materials: [material])
arView.scene.anchors.append(anchor)
anchor.addChild(entity)
return arView
我错过了什么?
【问题讨论】:
标签: swift xcode augmented-reality arkit realitykit