Post

Replies

Boosts

Views

Activity

Reply to Different display effects in AR
I found a way, but no shadow, how can i show the shadow. func session(_ session: ARSession, didAdd anchors: [ARAnchor])   {     anchors.compactMap { $0 as? ARImageAnchor }.forEach {               rootAnchor = AnchorEntity()       rootAnchor.transform.matrix = $0.transform       arView.scene.addAnchor(rootAnchor) add()     }   }   func session(_ session: ARSession, didUpdate anchors: [ARAnchor])   {     anchors.compactMap { $0 as? ARImageAnchor }.forEach {       rootAnchor.transform.matrix = $0.transform     }   }   fileprivate func add()   {     let audioPlane = MeshResource.generatePlane(width: 0.2, height: 0.2, cornerRadius: 0)     var audioMtl = SimpleMaterial()     do {       audioMtl.baseColor = try MaterialColorParameter.texture(TextureResource.load(named: "audio_play.png"))     } catch {     }     let audioEntity = ModelEntity(mesh: audioPlane, materials: [audioMtl])     audioEntity.position = [0, 0.1, 0]     rootAnchor.addChild(audioEntity)   }
Apr ’21
Reply to Different display effects in AR
    arView.automaticallyConfigureSession = false           configuration = ARWorldTrackingConfiguration()     if ARWorldTrackingConfiguration.supportsFrameSemantics(.personSegmentationWithDepth)     {       configuration.frameSemantics = .personSegmentationWithDepth     }     configuration.environmentTexturing = .automatic           guard let arAnchorCGImage = image.cgImage else { return }     let arReferenceImage = ARReferenceImage(arAnchorCGImage, orientation: .up, physicalWidth: CGFloat(0.1))     let arImages: SetARReferenceImage = [arReferenceImage]     configuration.detectionImages = arImages     configuration.maximumNumberOfTrackedImages = 1           arView.session.run(configuration)
Apr ’21