如何用遮罩对象使对象的背面不可见? (Swift,RealityKit,Reality Composer)

时间:2019-12-26 10:12:25

标签: swift xcode augmented-reality realitykit reality-composer

我想在AR投影时隐藏对象的背面。您会看到,物体在墙上有点加深了。我可以制作某种遮罩对象以使该对象不可见吗?

import UIKit
import RealityKit

class ViewController: UIViewController {

    @IBOutlet var arView: ARView!

    override func viewDidLoad() {
        super.viewDidLoad()

        // Load the "Box" scene from the "Experience" Reality File
        let ARscene1 = try! Experience.load_1()
        let ARscene2 = try! Experience.load_2()
        let ARscene3 = try! Experience.load_3() //that scene, object named "mask"

        // Add the box anchor to the scene
        arView.scene.anchors.append(ARscene1)
        arView.scene.anchors.append(ARscene2)
        arView.scene.anchors.append(ARscene3)
    }
}

图片:Click

0 个答案:

没有答案